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

Method as_proto

tensorflow/python/framework/tensor_shape.py:1174–1182  ·  view source on GitHub ↗

Returns this shape as a `TensorShapeProto`.

(self)

Source from the content-addressed store, hash-verified

1172 return [dim.value for dim in self._dims]
1173
1174 def as_proto(self):
1175 """Returns this shape as a `TensorShapeProto`."""
1176 if self._dims is None:
1177 return tensor_shape_pb2.TensorShapeProto(unknown_rank=True)
1178 else:
1179 return tensor_shape_pb2.TensorShapeProto(dim=[
1180 tensor_shape_pb2.TensorShapeProto.Dim(
1181 size=-1 if d.value is None else d.value) for d in self._dims
1182 ])
1183
1184 def __eq__(self, other):
1185 """Returns True if `self` is equivalent to `other`."""

Callers 15

testVariantMethod · 0.80
testZerosLikeVariantMethod · 0.80
_process_raw_parametersFunction · 0.80
testGetAttrMethod · 0.80

Calls 1

DimMethod · 0.45

Tested by 10

testVariantMethod · 0.64
testZerosLikeVariantMethod · 0.64
testGetAttrMethod · 0.64
testAsProtoMethod · 0.64
testShapeEqualsMethod · 0.64
testMakeAttrShapeMethod · 0.64
testMakeAttrShapeListMethod · 0.64