Lines Matching refs:context

69 bool validate(const IOperationValidationContext* context) {  in validate()  argument
70 NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs); in validate()
71 NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs); in validate()
73 const OperandType inputType = context->getInputType(kInputTensor); in validate()
74 const OperandType outputType = context->getOutputType(kOutputTensor); in validate()
83 return validateHalVersion(context, HalVersion::V1_3); in validate()
85 return validateHalVersion(context, HalVersion::V1_2); in validate()
89 bool prepare(IOperationExecutionContext* context) { in prepare() argument
90 const Shape& input = context->getInputShape(kInputTensor); in prepare()
91 Shape output = context->getOutputShape(kOutputTensor); in prepare()
93 return context->setOutputShape(kOutputTensor, output); in prepare()
96 bool execute(IOperationExecutionContext* context) { in execute() argument
98 if (getNumberOfElements(context->getOutputShape(kOutputTensor)) == 0) return true; in execute()
100 const OperandType inputType = context->getInputType(kInputTensor); in execute()
101 const OperandType outputType = context->getOutputType(kOutputTensor); in execute()
104 return quantizeToQuant8<float>(context->getInputBuffer<float>(kInputTensor), in execute()
105 context->getOutputBuffer<uint8_t>(kOutputTensor), in execute()
106 context->getOutputShape(kOutputTensor)); in execute()
108 return quantizeToQuant8Signed<float>(context->getInputBuffer<float>(kInputTensor), in execute()
109 context->getOutputBuffer<int8_t>(kOutputTensor), in execute()
110 context->getOutputShape(kOutputTensor)); in execute()
114 return quantizeToQuant8<_Float16>(context->getInputBuffer<_Float16>(kInputTensor), in execute()
115 context->getOutputBuffer<uint8_t>(kOutputTensor), in execute()
116 context->getOutputShape(kOutputTensor)); in execute()
118 return quantizeToQuant8Signed<_Float16>(context->getInputBuffer<_Float16>(kInputTensor), in execute()
119 context->getOutputBuffer<int8_t>(kOutputTensor), in execute()
120 context->getOutputShape(kOutputTensor)); in execute()
125 << " output type: " << toString(context->getOutputType(kOutputTensor)) in execute()