Lines Matching refs:operand

35         const Operand& operand = model.operands[i];  in getOperandsInfo()  local
37 .type = operand.type, in getOperandsInfo()
38 .dimensions = operand.dimensions, in getOperandsInfo()
39 .scale = operand.scale, in getOperandsInfo()
40 .zeroPoint = operand.zeroPoint, in getOperandsInfo()
41 .lifetime = operand.lifetime, in getOperandsInfo()
42 .buffer = const_cast<uint8_t*>(getData(operand, model.operandValues, pools)), in getOperandsInfo()
43 .length = operand.location.length, in getOperandsInfo()
104 const int32_t* Model::getPointer(uint32_t operand) { in getPointer() argument
105 return reinterpret_cast<const int32_t*>(mOperands[operand].buffer); in getPointer()
108 Shape Model::getShape(uint32_t operand) { in getShape() argument
110 .type = mOperands[operand].type, in getShape()
111 .dimensions = mOperands[operand].dimensions, in getShape()
112 .scale = mOperands[operand].scale, in getShape()
113 .offset = mOperands[operand].zeroPoint, in getShape()
117 bool Model::setShape(uint32_t operand, const Shape& shape) { in setShape() argument
118 const hexagon_nn_output& output = mOperands[operand].hexagon_output; in setShape()
121 mOperands[operand].dimensions = shape.dimensions; in setShape()
127 bool Model::isConstant(uint32_t operand) { in isConstant() argument
128 OperandLifeTime lifetime = mOperands[operand].lifetime; in isConstant()
148 const OperandInfo& operand = mOperands[operandIndex]; in addOperand() local
149 std::vector<uint32_t> dims = getAlignedDimensions(operand.dimensions, 4); in addOperand()
152 createTensorInternal(dims[0], dims[1], dims[2], dims[3], operand.buffer, operand.length); in addOperand()
157 const hexagon_nn_input& Model::getTensor(uint32_t operand) { in getTensor() argument
158 hexagon_nn_input& tensor = mOperands[operand].hexagon_input; in getTensor()
160 tensor = addOperand(operand); in getTensor()
165 const hexagon_nn_input& Model::getQuantizationMin(uint32_t operand) { in getQuantizationMin() argument
166 OperandInfo& operandInfo = mOperands[operand]; in getQuantizationMin()
177 const hexagon_nn_input& Model::getQuantizationMax(uint32_t operand) { in getQuantizationMax() argument
178 OperandInfo& operandInfo = mOperands[operand]; in getQuantizationMax()
189 hexagon_nn_padding_type Model::getPadding(uint32_t operand) { in getPadding() argument
190 const int32_t padding = getScalar<int32_t>(operand); in getPadding()
194 hexagon_nn_input Model::createQuantizationValue(uint32_t operand, int32_t quant_value) { in createQuantizationValue() argument
195 OperandInfo& operandInfo = mOperands[operand]; in createQuantizationValue()
200 hexagon_nn_input Model::createConvFilterTensor(uint32_t operand) { in createConvFilterTensor() argument
201 OperandInfo& operandInfo = mOperands[operand]; in createConvFilterTensor()
202 std::vector<uint32_t> dims = getAlignedDimensions(mOperands[operand].dimensions, 4); in createConvFilterTensor()
205 if (getShape(operand).type == OperandType::TENSOR_FLOAT32) { in createConvFilterTensor()
222 hexagon_nn_input Model::createDepthwiseFilterTensor(uint32_t operand, int32_t depth_multiplier) { in createDepthwiseFilterTensor() argument
223 OperandInfo& operandInfo = mOperands[operand]; in createDepthwiseFilterTensor()
224 std::vector<uint32_t> dims = getAlignedDimensions(mOperands[operand].dimensions, 4); in createDepthwiseFilterTensor()
231 hexagon_nn_input Model::createFullyConnectedWeightTensor(uint32_t operand) { in createFullyConnectedWeightTensor() argument
232 OperandInfo& operandInfo = mOperands[operand]; in createFullyConnectedWeightTensor()
233 std::vector<uint32_t> dims = getAlignedDimensions(mOperands[operand].dimensions, 4); in createFullyConnectedWeightTensor()
238 if (getShape(operand).type == OperandType::TENSOR_FLOAT32) { in createFullyConnectedWeightTensor()
253 op_type Model::getFloatActivation(uint32_t operand) { in getFloatActivation() argument
254 return getFloatActivationFunction(getScalar<FusedActivationFunc>(operand)); in getFloatActivation()
257 op_type Model::getQuantizedActivation(uint32_t operand) { in getQuantizedActivation() argument
258 return getQuantizedActivationFunction(getScalar<FusedActivationFunc>(operand)); in getQuantizedActivation()
297 const OperandInfo& operand = mOperands[index]; in getHexagonOutputs() local
298 outputs.push_back(make_hexagon_nn_output(operand.dimensions, getSize(operand.type))); in getHexagonOutputs()
299 if (operand.type == OperandType::TENSOR_QUANT8_ASYMM) { in getHexagonOutputs()
310 OperandInfo& operand = mOperands[operands[i]]; in registerHexagonInputs() local
311 HEXAGON_SOFT_ASSERT_EQ(operand.hexagon_input, hexagon_nn_input{}, in registerHexagonInputs()
313 operand.hexagon_input = {.src_id = node, .output_idx = idx++}; in registerHexagonInputs()
314 if (operand.type == OperandType::TENSOR_QUANT8_ASYMM) { in registerHexagonInputs()
315 operand.hexagon_input_min = {.src_id = node, .output_idx = idx++}; in registerHexagonInputs()
316 operand.hexagon_input_max = {.src_id = node, .output_idx = idx++}; in registerHexagonInputs()
480 for (const OperandInfo& operand : mOperands) { in verifyOperands() local
481 HEXAGON_SOFT_ASSERT_GE(4ul, operand.dimensions.size(), in verifyOperands()
483 for (uint32_t dim : operand.dimensions) { in verifyOperands()
494 OperandInfo& operand = mOperands[mInputs[i]]; in addInputs() local
495 outs.push_back(make_hexagon_nn_output(operand.dimensions, getSize(operand.type))); in addInputs()
504 OperandInfo& operand = mOperands[mInputs[i]]; in addInputs() local
505 operand.hexagon_input = {.src_id = node, .output_idx = static_cast<uint32_t>(i)}; in addInputs()
535 OperandInfo& operand = mOperands[out]; in addOutputs() local
536 HEXAGON_SOFT_ASSERT_NE(operand.hexagon_input, hexagon_nn_input{}, in addOutputs()
539 if (operand.type == OperandType::TENSOR_QUANT8_ASYMM) { in addOutputs()
543 {operand.hexagon_input, operand.hexagon_input_min, operand.hexagon_input_max}, in addOutputs()
544 {make_hexagon_nn_output(operand.dimensions, sizeof(float))}); in addOutputs()
550 {make_hexagon_nn_output(operand.dimensions, sizeof(uint8_t)), in addOutputs()
555 ins.push_back(operand.hexagon_input); in addOutputs()
568 for (OperandInfo& operand : mOperands) { in clearModel()
569 operand.hexagon_input = {}; in clearModel()
570 operand.hexagon_input_min = {}; in clearModel()
571 operand.hexagon_input_max = {}; in clearModel()
572 operand.hexagon_output = {}; in clearModel()
625 static hexagon_nn_tensordef convertToTensordef(const OperandInfo& operand) { in convertToTensordef() argument
626 std::vector<uint32_t> dimensions = getAlignedDimensions(operand.dimensions, 4); in convertToTensordef()
632 .data = operand.buffer, in convertToTensordef()
633 .dataLen = static_cast<int32_t>(operand.length), in convertToTensordef()
634 .data_valid_len = operand.length, // unused? in convertToTensordef()
639 static uint32_t getSize(const OperandInfo& operand) { in getSize() argument
640 return std::accumulate(operand.dimensions.begin(), operand.dimensions.end(), in getSize()
641 getSize(operand.type), std::multiplies<>{}); in getSize()