| 54 | } |
| 55 | |
| 56 | TfLiteStatus 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 |
no test coverage detected