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

Method Compute

tensorflow/core/kernels/variable_ops.cc:165–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163 : OpKernel(context) {}
164
165 void Compute(OpKernelContext* context) override {
166 // Get a mutable input tensor of the Ref input.
167 const Tensor& input_tensor = context->mutable_input(0, false);
168 Tensor* output = nullptr;
169 OP_REQUIRES_OK(context,
170 context->allocate_output(0, TensorShape({}), &output));
171 auto output_tensor = output->tensor<bool, 0>();
172 bool result = input_tensor.IsInitialized();
173 output_tensor() = result;
174 }
175};
176
177REGISTER_KERNEL_BUILDER(Name("Variable").Device(DEVICE_CPU), VariableOp);

Callers

nothing calls this directly

Calls 4

allocate_outputMethod · 0.80
TensorShapeClass · 0.50
mutable_inputMethod · 0.45
IsInitializedMethod · 0.45

Tested by

no test coverage detected