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

Function TF_GetInput

tensorflow/c/kernels.cc:176–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void TF_GetInput(TF_OpKernelContext* ctx, int i, TF_Tensor** tensor,
177 TF_Status* status) {
178 auto* cc_ctx = reinterpret_cast<::tensorflow::OpKernelContext*>(ctx);
179 if (i < 0 || i >= cc_ctx->num_inputs()) {
180 TF_SetStatus(status, TF_OUT_OF_RANGE, "input index out of range");
181 return;
182 }
183 const ::tensorflow::Tensor& cc_tensor(cc_ctx->input(i));
184 TF_Tensor* result = ::tensorflow::TF_TensorFromTensor(cc_tensor, status);
185 if (TF_GetCode(status) == TF_OK) {
186 *tensor = result;
187 }
188}
189
190void TF_SetOutput(TF_OpKernelContext* ctx, int i, const TF_Tensor* tensor,
191 TF_Status* status) {

Callers 3

computeFunction · 0.85
TESTFunction · 0.85
BitcastOp_ComputeFunction · 0.85

Calls 4

TF_SetStatusFunction · 0.85
TF_TensorFromTensorFunction · 0.85
TF_GetCodeFunction · 0.85
num_inputsMethod · 0.45

Tested by 2

computeFunction · 0.68
TESTFunction · 0.68