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

Method Compute

tensorflow/core/kernels/summary_tensor_op.cc:79–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 explicit SummaryTensorOp(OpKernelConstruction* context) : OpKernel(context) {}
78
79 void Compute(OpKernelContext* c) override {
80 const Tensor& tensor = c->input(0);
81
82 Summary s;
83 Summary::Value* v = s.add_value();
84 v->set_node_name(c->op_kernel().name());
85
86 if (tensor.dtype() == DT_STRING) {
87 // tensor_util.makeNdarray doesn't work for strings in tensor_content
88 tensor.AsProtoField(v->mutable_tensor());
89 } else {
90 tensor.AsProtoTensorContent(v->mutable_tensor());
91 }
92
93 Tensor* summary_tensor = nullptr;
94 OP_REQUIRES_OK(c, c->allocate_output(0, TensorShape({}), &summary_tensor));
95 CHECK(SerializeToTString(s, &summary_tensor->scalar<tstring>()()));
96 }
97};
98
99#define REGISTER(T) \

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected