| 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 | |
| 177 | REGISTER_KERNEL_BUILDER(Name("Variable").Device(DEVICE_CPU), VariableOp); |
nothing calls this directly
no test coverage detected