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

Function GetHandle

tensorflow/core/kernels/tensor_array_ops.cc:54–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52namespace tensorflow {
53
54Status GetHandle(OpKernelContext* ctx, string* container, string* ta_handle) {
55 {
56 Tensor tensor;
57 // Assuming that handle is the input at index 0.
58 if (IsRefType(ctx->input_dtype(0))) {
59 tensor = ctx->mutable_input(0, false);
60 } else {
61 tensor = ctx->input(0);
62 }
63 if (tensor.NumElements() != 2) {
64 return errors::InvalidArgument(
65 "Tensor array handle must be 2-element vector, but had shape: ",
66 tensor.shape().DebugString());
67 }
68 auto h = tensor.flat<tstring>();
69 *container = h(0);
70 *ta_handle = h(1);
71 }
72 return Status::OK();
73}
74
75Status GetTensorArray(OpKernelContext* ctx, TensorArray** tensor_array) {
76 string container;

Callers 2

GetTensorArrayFunction · 0.85
CreateTensorArrayMethod · 0.85

Calls 8

IsRefTypeFunction · 0.85
InvalidArgumentFunction · 0.85
input_dtypeMethod · 0.45
mutable_inputMethod · 0.45
inputMethod · 0.45
NumElementsMethod · 0.45
DebugStringMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected