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

Method AsProtoTensorContent

tensorflow/core/framework/tensor.cc:1013–1021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1011}
1012
1013void Tensor::AsProtoTensorContent(TensorProto* proto) const {
1014 proto->Clear();
1015 proto->set_dtype(dtype());
1016 shape_.AsProto(proto->mutable_tensor_shape());
1017 if (buf_) {
1018 CASES(dtype(), Helper<T>::Encode(buf_, shape_.num_elements(),
1019 proto->mutable_tensor_content()));
1020 }
1021}
1022
1023size_t Tensor::TotalBytes() const {
1024 if (shape_.num_elements() == 0) return 0;

Callers 15

Create1DStringConstOpFunction · 0.80
CreateDefaultValueNodeFunction · 0.80
CreateFakeConstOpFunction · 0.80
TESTFunction · 0.80
SetNodeTensorAttrFunction · 0.80
TestGetNodeTensorAttrMethod · 0.80
AddRequestMethod · 0.80
RecvTensorAsyncMethod · 0.80
FuseRecvTensorAsyncMethod · 0.80
InitStarClientTagFunction · 0.80
FillRespBodyMethod · 0.80

Calls 6

dtypeFunction · 0.50
EncodeFunction · 0.50
ClearMethod · 0.45
set_dtypeMethod · 0.45
AsProtoMethod · 0.45
num_elementsMethod · 0.45

Tested by 15

TESTFunction · 0.64
TestGetNodeTensorAttrMethod · 0.64
TestConvertConstFunction · 0.64
TEST_FFunction · 0.64
operator==Function · 0.64
TestCopiesFunction · 0.64
TEST_FFunction · 0.64
TESTFunction · 0.64
RunInfiniteTFLoopFunction · 0.64
SetNodeAttrFunction · 0.64
GetTensorProtoFunction · 0.64