You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/05/19 00:19:51 UTC
[GitHub] eric-haibin-lin commented on a change in pull request #11001:
[MXNET-374] handle row_sparse weight in parameter and trainer
eric-haibin-lin commented on a change in pull request #11001: [MXNET-374] handle row_sparse weight in parameter and trainer
URL: https://github.com/apache/incubator-mxnet/pull/11001#discussion_r189417354
##########
File path: python/mxnet/gluon/block.py
##########
@@ -445,6 +445,14 @@ class HybridBlock(Block):
the end-to-end usage.
"""
def __init__(self, prefix=None, params=None):
+ # check if any parameter is row_sparse
+ if isinstance(params, ParameterDict):
+ for param in params.values():
+ stype = param._stype
+ if stype != 'default':
+ raise ValueError("Cannot create a HybridBlock with Parameter '%s' " \
+ "because its storage type is %s. Please consider " \
+ "using a SparseBlock instead."%(param.name, stype))
Review comment:
PR for sparse block will be created separately after this one is merged.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services