Lines Matching refs:context
101 bool validate(const IOperationValidationContext* context) { in validate() argument
102 NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs); in validate()
103 NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs); in validate()
104 auto inputType = context->getInputType(kInputTensor); in validate()
110 NN_RET_CHECK(validateInputTypes(context, {inputType, inputType})); in validate()
111 NN_RET_CHECK(validateOutputTypes(context, {inputType})); in validate()
113 return validateHalVersion(context, HalVersion::V1_3); in validate()
115 return validateHalVersion(context, HalVersion::V1_2); in validate()
119 bool prepare(IOperationExecutionContext* context) { in prepare() argument
120 Shape input = context->getInputShape(kInputTensor); in prepare()
121 Shape alpha = context->getInputShape(kAlphaTensor); in prepare()
123 Shape output = context->getOutputShape(kOutputTensor); in prepare()
125 return context->setOutputShape(kOutputTensor, output); in prepare()
128 bool execute(IOperationExecutionContext* context) { in execute() argument
129 switch (context->getInputType(kInputTensor)) { in execute()
135 context->getInputBuffer<_Float16>(kInputTensor), in execute()
136 context->getInputShape(kInputTensor), in execute()
137 context->getInputBuffer<_Float16>(kAlphaTensor), in execute()
138 context->getInputShape(kAlphaTensor), in execute()
139 context->getOutputBuffer<_Float16>(kOutputTensor), in execute()
140 context->getOutputShape(kOutputTensor)); in execute()
146 context->getInputBuffer<float>(kInputTensor), in execute()
147 context->getInputShape(kInputTensor), in execute()
148 context->getInputBuffer<float>(kAlphaTensor), in execute()
149 context->getInputShape(kAlphaTensor), in execute()
150 context->getOutputBuffer<float>(kOutputTensor), in execute()
151 context->getOutputShape(kOutputTensor)); in execute()
153 return evalQuant8(context->getInputBuffer<uint8_t>(kInputTensor), in execute()
154 context->getInputShape(kInputTensor), in execute()
155 context->getInputBuffer<uint8_t>(kAlphaTensor), in execute()
156 context->getInputShape(kAlphaTensor), in execute()
157 context->getOutputBuffer<uint8_t>(kOutputTensor), in execute()
158 context->getOutputShape(kOutputTensor)); in execute()
161 return evalQuant8(context->getInputBuffer<int8_t>(kInputTensor), in execute()
162 context->getInputShape(kInputTensor), in execute()
163 context->getInputBuffer<int8_t>(kAlphaTensor), in execute()
164 context->getInputShape(kAlphaTensor), in execute()
165 context->getOutputBuffer<int8_t>(kOutputTensor), in execute()
166 context->getOutputShape(kOutputTensor)); in execute()