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

Function GetAxisValueFromTensor

tensorflow/lite/kernels/expand_dims.cc:56–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56TfLiteStatus GetAxisValueFromTensor(TfLiteContext* context,
57 const TfLiteTensor& axis, int* axis_value) {
58 TF_LITE_ENSURE_EQ(context, NumElements(&axis), 1);
59 switch (axis.type) {
60 case kTfLiteInt32:
61 *axis_value = *GetTensorData<int32_t>(&axis);
62 return kTfLiteOk;
63 case kTfLiteInt64:
64 *axis_value = *GetTensorData<int64_t>(&axis);
65 return kTfLiteOk;
66 default:
67 return kTfLiteError;
68 }
69}
70
71} // namespace
72

Callers 2

PrepareFunction · 0.85
EvalFunction · 0.85

Calls 1

NumElementsFunction · 0.70

Tested by

no test coverage detected