MCPcopy Create free account
hub / github.com/pytorch/pytorch / _validate_metadata

Method _validate_metadata

caffe2/python/schema.py:778–785  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

776 self._validate_metadata()
777
778 def _validate_metadata(self):
779 if self._metadata is None:
780 return
781 if (self._metadata.categorical_limit is not None and
782 self.dtype is not None):
783 assert np.issubdtype(self.dtype, np.integer), \
784 "`categorical_limit` can be specified only in integral " + \
785 "fields but got {}".format(self.dtype)
786
787 def set_value(self, blob, throw_on_type_mismatch=False, unsafe=False):
788 """Sets only the blob field still validating the existing dtype"""

Callers 3

set_metadataMethod · 0.95
setMethod · 0.95
set_typeMethod · 0.95

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected