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

Function CreateAsProtoField

tensorflow/core/framework/tensor_util_test.cc:519–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517
518template <typename T>
519TensorProto CreateAsProtoField(int size, int tail_length) {
520 auto values = VectorWithConstantTail<T>(size, tail_length);
521 Tensor tensor(DataTypeToEnum<T>::value, TensorShape({size}));
522 std::copy(values.begin(), values.end(), tensor.flat<T>().data());
523 TensorProto tensor_proto;
524 tensor.AsProtoField(&tensor_proto);
525 return tensor_proto;
526}
527
528template <typename T>
529void CompareTensorValues(const TensorProto& x, const TensorProto& y) {

Callers

nothing calls this directly

Calls 6

AsProtoFieldMethod · 0.80
TensorShapeClass · 0.70
copyFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected