tensorflow/lite/kernels/sign.cc
// Performs common preparation for pointwise, unary ops, i.e., type checks and
// output tensor resizing.
Performs common preparation for pointwise, unary ops, i.e., type checks and
output tensor resizing.
Performs common preparation for pointwise unary ops i . e . type checks and output tensor resizing .
TfLiteStatus PointwiseUnaryOpPrepare(TfLiteContext* context, TfLiteNode* node) {
  TF_LITE_ENSURE_EQ(context, tflite::NumInputs(node), 1);
  const TfLiteTensor* input = tflite::GetInput(context, node, 0);
  TfLiteTensor* output = tflite::GetOutput(context, node, 0);
  TF_LITE_ENSURE_TYPES_EQ(context, input->type, output->type);
  TfLiteIntArray* output_shape = TfLiteIntArrayCopy(input->dims);
  return context->ResizeTensor(context, output, output_shape);
}
TfLiteStatus PointwiseUnaryOpPrepare ( TfLiteContext * context , TfLiteNode * node ) { TF_LITE_ENSURE_EQ ( context , tflite :: NumInputs ( node ) , 1 ) ; const TfLiteTensor * input = tflite :: GetInput ( context , node , 0 ) ; TfLiteTensor * output = tflite :: GetOutput ( context , node , 0 ) ; TF_LITE_ENSURE_TYPES_EQ ( context , input -> type , output -> type ) ; TfLiteIntArray * output_shape = TfLiteIntArrayCopy ( input -> dims ) ; return context -> ResizeTensor ( context , output , output_shape ) ; }
Performs common preparation for pointwise, unary ops, i.e., type checks and
output tensor resizing.
Performs common preparation for pointwise unary ops i . e . type checks and output tensor resizing .
// Validate size and type constraints