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

Method Compute

tensorflow/core/kernels/parse_tensor_op.cc:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 using OpKernel::OpKernel;
73
74 void Compute(OpKernelContext* context) override {
75 const Tensor& tensor = context->input(0);
76 TensorProto proto;
77 if (tensor.dtype() == DT_STRING) {
78 tensor.AsProtoField(&proto);
79 } else {
80 tensor.AsProtoTensorContent(&proto);
81 }
82 Tensor* proto_string = nullptr;
83 OP_REQUIRES_OK(context,
84 context->allocate_output(0, TensorShape({}), &proto_string));
85 CHECK(SerializeToTString(proto, &proto_string->scalar<tstring>()()));
86 }
87};
88
89#define REGISTER(T) \

Callers

nothing calls this directly

Calls 7

SerializeToTStringFunction · 0.85
AsProtoFieldMethod · 0.80
AsProtoTensorContentMethod · 0.80
allocate_outputMethod · 0.80
TensorShapeClass · 0.50
inputMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected