mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-05 00:14:54 +08:00
logging the blob that has type error
Summary: Currently, it's not easy to track down which tensor is missing type and shape info. Print it out for easier debuggin. Reviewed By: volkhin, xianjiec Differential Revision: D5695223 fbshipit-source-id: 7f0be0be777a35bb5a71b3799b29b91f0763c159
This commit is contained in:
committed by
Facebook Github Bot
parent
409d985d43
commit
d368b59177
@ -1079,6 +1079,7 @@ def InitEmptyRecord(net, schema_or_record, enforce_types=False):
|
||||
shape = [0] + list(blob_type.shape)
|
||||
net.ConstantFill([], blob, shape=shape, dtype=data_type)
|
||||
except TypeError:
|
||||
logger.warning("Blob {} has type error".format(blob))
|
||||
# If data_type_for_dtype doesn't know how to resolve given numpy
|
||||
# type to core.DataType, that function can throw type error (for
|
||||
# example that would happen for cases of unknown types such as
|
||||
|
||||
Reference in New Issue
Block a user