MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _recreate_constant

Method _recreate_constant

tensorflow/python/saved_model/load.py:386–394  ·  view source on GitHub ↗
(self, proto)

Source from the content-addressed store, hash-verified

384 aggregation=aggregation), setattr
385
386 def _recreate_constant(self, proto):
387 tensor_proto = self._operation_attributes[proto.operation]["value"].tensor
388 ndarray = tensor_util.MakeNdarray(tensor_proto)
389 if dtypes.as_dtype(tensor_proto.dtype) == dtypes.string:
390 with ops.device("CPU"):
391 imported_constant = constant_op.constant(ndarray)
392 else:
393 imported_constant = constant_op.constant(ndarray)
394 return imported_constant, setattr
395
396 def _recreate_resource(self, proto):
397 return _RestoredResource(device=proto.device), setattr

Callers 1

_recreateMethod · 0.95

Calls 2

deviceMethod · 0.45
constantMethod · 0.45

Tested by

no test coverage detected