Home
last modified time | relevance | path

Searched refs:ElementsNum (Results 1 – 25 of 276) sorted by relevance

12345678910>>...12

/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/fp16/
Dfused_batchnorm_fp16.cc45 std::fill(current_mean, current_mean + in_tensors_.at(kInCurrentMeanIdx)->ElementsNum(), 0.f); in CalcMeanVar()
46 std::fill(current_var, current_var + in_tensors_.at(kInCurrentVarIdx)->ElementsNum(), 0.f); in CalcMeanVar()
78 auto input_fp16 = ms_context_->allocator->Malloc(input->ElementsNum() * sizeof(float16_t)); in DoExecute()
79 auto scale_fp16 = ms_context_->allocator->Malloc(scale->ElementsNum() * sizeof(float16_t)); in DoExecute()
80 auto offset_fp16 = ms_context_->allocator->Malloc(offset->ElementsNum() * sizeof(float16_t)); in DoExecute()
81 auto mean_fp16 = ms_context_->allocator->Malloc(mean->ElementsNum() * sizeof(float16_t)); in DoExecute()
82 … auto variance_fp16 = ms_context_->allocator->Malloc(variance->ElementsNum() * sizeof(float16_t)); in DoExecute()
83 auto output_fp16 = ms_context_->allocator->Malloc(output->ElementsNum() * sizeof(float16_t)); in DoExecute()
100 input->ElementsNum()); in DoExecute()
102 scale->ElementsNum()); in DoExecute()
[all …]
Dbatchnorm_fp16.cc37 CHECK_LESS_RETURN(MAX_MALLOC_SIZE, mean_fp32->ElementsNum() * sizeof(float16_t)); in InitConstTensor()
38 CHECK_LESS_RETURN(MAX_MALLOC_SIZE, variance_fp32->ElementsNum() * sizeof(float16_t)); in InitConstTensor()
39 mean_ = malloc(mean_fp32->ElementsNum() * sizeof(float16_t)); in InitConstTensor()
40 variance_ = malloc(variance_fp32->ElementsNum() * sizeof(float16_t)); in InitConstTensor()
48 mean_fp32->ElementsNum()); in InitConstTensor()
50 variance_fp32->ElementsNum()); in InitConstTensor()
79 …ToFloat32(output_, reinterpret_cast<float *>(output_tensor->data()), output_tensor->ElementsNum()); in Run()
Daddn_fp16.cc57 elements_num_ = out_tensors_[0]->ElementsNum(); in Run()
69 param.in_elements_num0_ = in_tensors_[0]->ElementsNum(); in Run()
70 param.in_elements_num1_ = in_tensors_[1]->ElementsNum(); in Run()
71 param.out_elements_num_ = out_tensors_[0]->ElementsNum(); in Run()
82 param.in_elements_num0_ = in_tensors_[i]->ElementsNum(); in Run()
83 param.in_elements_num1_ = out_tensors_[0]->ElementsNum(); in Run()
84 param.out_elements_num_ = out_tensors_[0]->ElementsNum(); in Run()
Dbiasadd_fp16.cc65 size_t data_size = in_tensors_.at(0)->ElementsNum(); in Run()
93 MS_CHECK_INT_MUL_NOT_OVERFLOW(bias_tensor_->ElementsNum(), sizeof(float16_t), RET_ERROR); in GetBiasData()
94 …bias_data_ = reinterpret_cast<float16_t *>(malloc(bias_tensor_->ElementsNum() * sizeof(float16_t))… in GetBiasData()
105 for (int i = 0; i < bias_tensor_->ElementsNum(); ++i) { in GetBiasData()
132 for (int i = 0; i < bias_tensor_->ElementsNum(); ++i) { in PackWeight()
Dgather_fp16.cc50 …reinterpret_cast<float16_t *>(ms_context_->allocator->Malloc(input_tensor->ElementsNum() * sizeof(… in Init()
55 …Float16(reinterpret_cast<float *>(input_tensor->data()), input_data_, input_tensor->ElementsNum()); in Init()
74 int indices_element_size = indices_tensor->ElementsNum(); in DoGather()
132 int indices_num = indices_tensor->ElementsNum(); in Run()
144 …reinterpret_cast<float16_t *>(ms_context_->allocator->Malloc(input_tensor->ElementsNum() * sizeof(… in Run()
150 …Float16(reinterpret_cast<float *>(input_tensor->data()), input_data_, input_tensor->ElementsNum()); in Run()
Dpad_fp16.cc75 int unit = UP_DIV(out_tensors_.at(0)->ElementsNum(), op_parameter_->thread_num_); in RunMirrorPadImpl()
77 int end = MSMIN(begin + unit, out_tensors_.at(0)->ElementsNum()); in RunMirrorPadImpl()
85 auto value_num = pad_value->ElementsNum(); in Run()
110 memset(output_, 0, output_tensor->ElementsNum() * sizeof(float16_t)); in Run()
112 for (int i = 0; i < output_tensor->ElementsNum(); ++i) { in Run()
/third_party/mindspore/mindspore/lite/src/
Dtensorlist.cc68 for (int i = 0; i < this->ElementsNum(); ++i) { in CopyTensorData()
98 if (static_cast<size_t>(this->ElementsNum()) != tensor_shape.size()) { in MallocTensorListData()
99 MS_LOG(ERROR) << "tensorlist ElementsNum():" << this->ElementsNum() in MallocTensorListData()
104 for (int i = 0; i < this->ElementsNum(); ++i) { in MallocTensorListData()
125 for (int i = 0; i < this->ElementsNum(); ++i) { in MallocData()
182 if (index < 0 || index > (this->ElementsNum() - 1)) { in SetTensor()
183 MS_LOG(ERROR) << "index:" << index << " must in [0, " << this->ElementsNum() - 1 << "]!"; in SetTensor()
198 for (int i = 0; i < this->ElementsNum(); ++i) { in CheckTensorListParam()
216 MS_LOG(ERROR) << "index:" << index << " must in [0, " << this->ElementsNum() - 1 << "]!"; in GetTensor()
240 if (static_cast<size_t>(src->ElementsNum()) != this->element_shape_.size()) { in IsCompatibleShape()
[all …]
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/
Dpad_int8_tests.cc39 memcpy(in_t->MutableData(), in, sizeof(int8_t) * in_t->ElementsNum()); in PadInt8TestInit1()
52 *correct = reinterpret_cast<int8_t *>(malloc(out_t->ElementsNum() * sizeof(int8_t))); in PadInt8TestInit1()
54 memcpy(*correct, co, out_t->ElementsNum() * sizeof(int8_t)); in PadInt8TestInit1()
60 return out_t->ElementsNum(); in PadInt8TestInit1()
90 memcpy(in_t->MutableData(), in, sizeof(int8_t) * in_t->ElementsNum()); in PadInt8TestInit2()
103 *correct = reinterpret_cast<int8_t *>(malloc(out_t->ElementsNum() * sizeof(int8_t))); in PadInt8TestInit2()
107 memcpy(*correct, co, out_t->ElementsNum() * sizeof(int8_t)); in PadInt8TestInit2()
113 return out_t->ElementsNum(); in PadInt8TestInit2()
143 memcpy(in_t->MutableData(), in, sizeof(int8_t) * in_t->ElementsNum()); in PadInt8TestInit4()
156 *correct = reinterpret_cast<int8_t *>(malloc(out_t->ElementsNum() * sizeof(int8_t))); in PadInt8TestInit4()
[all …]
Dconv_1x1_int8_tests.cc81 memcpy(in_t->MutableData(), in, in_t->ElementsNum() * sizeof(int8_t)); in Conv1x1Int8TestInit1_perchannel()
96 memcpy(weight_t->MutableData(), weight, weight_t->ElementsNum() * sizeof(int8_t)); in Conv1x1Int8TestInit1_perchannel()
106 *correct = reinterpret_cast<int8_t *>(malloc(out_t->ElementsNum() * sizeof(int8_t))); in Conv1x1Int8TestInit1_perchannel()
108 memcpy(*correct, nchw_co, out_t->ElementsNum() * sizeof(int8_t)); in Conv1x1Int8TestInit1_perchannel()
115 return out_t->ElementsNum(); in Conv1x1Int8TestInit1_perchannel()
151 Quantize(in, in_t->ElementsNum(), in_quant_arg->scale, in_quant_arg->zeroPoint, in Conv1x1Int8TestInit1()
162 Quantize(weight, weight_t->ElementsNum(), weight_quant_arg->scale, weight_quant_arg->zeroPoint, in Conv1x1Int8TestInit1()
173 *correct = reinterpret_cast<int8_t *>(malloc(out_t->ElementsNum() * sizeof(int8_t))); in Conv1x1Int8TestInit1()
177 …Quantize(nchw_co, out_t->ElementsNum(), output_quant_arg->scale, output_quant_arg->zeroPoint, *cor… in Conv1x1Int8TestInit1()
184 return out_t->ElementsNum(); in Conv1x1Int8TestInit1()
[all …]
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/fp32/
Daddn_fp32.cc61 elements_num_ = out_tensors_[0]->ElementsNum(); in Run()
73 param.in_elements_num0_ = in_tensors_[0]->ElementsNum(); in Run()
74 param.in_elements_num1_ = in_tensors_[1]->ElementsNum(); in Run()
75 param.out_elements_num_ = out_tensors_[0]->ElementsNum(); in Run()
87 param.in_elements_num0_ = in_tensors_[i]->ElementsNum(); in Run()
88 param.in_elements_num1_ = out_tensors_[0]->ElementsNum(); in Run()
89 param.out_elements_num_ = out_tensors_[0]->ElementsNum(); in Run()
Dscale_fp32.cc49 scale_ = reinterpret_cast<float *>(malloc(scale_tensor->ElementsNum() * sizeof(float))); in InitScaleOffset()
54 memcpy(scale_, scale_tensor->data(), scale_tensor->ElementsNum() * sizeof(float)); in InitScaleOffset()
62 offset_ = reinterpret_cast<float *>(malloc(scale_tensor->ElementsNum() * sizeof(float))); in InitScaleOffset()
67 memset(offset_, 0, scale_tensor->ElementsNum() * sizeof(float)); in InitScaleOffset()
71 MS_CHECK_TRUE_RET(scale_tensor->ElementsNum() == offset_tensor->ElementsNum(), RET_ERROR); in InitScaleOffset()
72 offset_ = reinterpret_cast<float *>(malloc(offset_tensor->ElementsNum() * sizeof(float))); in InitScaleOffset()
77 memcpy(offset_, offset_tensor->data(), offset_tensor->ElementsNum() * sizeof(float)); in InitScaleOffset()
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/
Dfullconnection_fp32_tests.cc41 memcpy(in_t->MutableData(), in, sizeof(float) * in_t->ElementsNum()); in FcTestInit1()
50 memcpy(weight_t->MutableData(), weight, sizeof(float) * weight_t->ElementsNum()); in FcTestInit1()
56 memcpy(bias_t->MutableData(), bias, sizeof(float) * bias_t->ElementsNum()); in FcTestInit1()
63 *correct = reinterpret_cast<float *>(malloc(out_t->ElementsNum() * sizeof(float))); in FcTestInit1()
65 memcpy(*correct, nchw_co, out_t->ElementsNum() * sizeof(float)); in FcTestInit1()
74 return out_t->ElementsNum(); in FcTestInit1()
133 *correct = reinterpret_cast<float *>(malloc(out_t->ElementsNum() * sizeof(float))); in FcTestInit2()
136 memcpy(*correct, out_data, out_t->ElementsNum() * sizeof(float)); in FcTestInit2()
144 return out_t->ElementsNum(); in FcTestInit2()
179 memcpy(in_t->MutableData(), in, sizeof(float) * in_t->ElementsNum()); in FcTestInit3()
[all …]
Ddetection_post_process_test.cc77 memset(output_boxes->MutableData(), 0, output_boxes->ElementsNum() * sizeof(float)); in DetectionPostProcessTestInit()
84 memset(output_classes->MutableData(), 0, output_classes->ElementsNum() * sizeof(float)); in DetectionPostProcessTestInit()
91 memset(output_scores->MutableData(), 0, output_scores->ElementsNum() * sizeof(float)); in DetectionPostProcessTestInit()
98 memset(output_num_det->MutableData(), 0, output_num_det->ElementsNum() * sizeof(float)); in DetectionPostProcessTestInit()
137 ASSERT_EQ(0, CompareOutputData(output_boxes, correct_boxes, outputs_[0]->ElementsNum(), 0.0001)); in TEST_F()
144 …ASSERT_EQ(0, CompareOutputData(output_classes, correct_classes, outputs_[1]->ElementsNum(), 0.0001… in TEST_F()
151 …ASSERT_EQ(0, CompareOutputData(output_scores, correct_scores, outputs_[2]->ElementsNum(), 0.0001)); in TEST_F()
158 …ASSERT_EQ(0, CompareOutputData(output_num_det, correct_num_det, outputs_[3]->ElementsNum(), 0.0001… in TEST_F()
Dpower_fp32_tests.cc33 memcpy(in_t->MutableData(), a_ptr, sizeof(float) * in_t->ElementsNum()); in PowerTestInit()
38 memcpy(weight_t->MutableData(), b_ptr, sizeof(float) * weight_t->ElementsNum()); in PowerTestInit()
45 return out_t->ElementsNum(); in PowerTestInit()
52 memcpy(in_t->MutableData(), a_ptr, sizeof(float) * in_t->ElementsNum()); in PowerTestInit2()
59 return out_t->ElementsNum(); in PowerTestInit2()
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/control/
Dtensorlist_getitem.cc44 int dim0 = input0->ElementsNum(); in Run()
52 if (src_ptr->ElementsNum() != out_tensors_.at(0)->ElementsNum()) { in Run()
53 MS_LOG(ERROR) << "src_ptr->ElementsNum():" << src_ptr->ElementsNum() in Run()
54 … << " must be equal to out_tensors_[0]->ElementsNum():" << out_tensors_.at(0)->ElementsNum(); in Run()
Dtensorlist_fromtensor.cc35 int in1_ele_num = input1_->ElementsNum(); in IsCompatibleShape()
88 if (dim0 != output0->ElementsNum()) { in Run()
89 …MS_LOG(ERROR) << "output0_->ElementsNum():" << output0->ElementsNum() << " must be equal to dim0:"… in Run()
96 int devision_dim0 = input0_->ElementsNum() / dim0; in Run()
104 if (out_ptr->ElementsNum() != devision_dim0) { in Run()
105 MS_LOG(ERROR) << "tensors_[" << i << "].ElementsNum():" << out_ptr->ElementsNum() in Run()
Dtensorlist_stack.cc34 if (num_element_ != -1 && input0_->ElementsNum() != num_element_) { in CheckParam()
35 …MS_LOG(ERROR) << "in_tensors_.at(0).ElementsNum():[" << input0_->ElementsNum() << "] must be equal… in CheckParam()
39 num_element_ = input0_->ElementsNum(); in CheckParam()
82 for (int i = 0; i < in_tensors_.at(1)->ElementsNum(); ++i) { in MergeElementShape()
96 for (int i = 0; i < input0_->ElementsNum(); ++i) { // get tensorlist every tensor in MergeElementShape()
148 size_t out_ele_num = output0_->ElementsNum(); in Run()
175 int data_size = in_ptr->ElementsNum() * lite::DataTypeSize(dtype_); in Run()
/third_party/mindspore/mindspore/lite/micro/example/mnist_stm32f746/mnist_stm32f746/benchmark/
Dcalib_output.cc112 if (output->ElementsNum() != calib->ElementsNum()) { in CompareOutputs()
119 … += CompareData(static_cast<float *>(output->data()), calib->MutableData(), output->ElementsNum()); in CompareOutputs()
123 …+= CompareData(static_cast<int8_t *>(output->data()), calib->MutableData(), output->ElementsNum()); in CompareOutputs()
127 …= CompareData(static_cast<uint8_t *>(output->data()), calib->MutableData(), output->ElementsNum()); in CompareOutputs()
132 …= CompareData(static_cast<int32_t *>(output->data()), calib->MutableData(), output->ElementsNum()); in CompareOutputs()
Dbenchmark.cc69 printf("Elements: %d, ", tensor->ElementsNum()); in TensorToString()
77 PrintData<float>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
80 PrintData<int16_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
83 PrintData<int32_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
86 PrintData<int16_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
89 PrintData<int8_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
92 PrintData<uint8_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
/third_party/mindspore/mindspore/lite/micro/example/mnist_x86/benchmark/
Dcalib_output.cc112 if (output->ElementsNum() != calib->ElementsNum()) { in CompareOutputs()
119 … += CompareData(static_cast<float *>(output->data()), calib->MutableData(), output->ElementsNum()); in CompareOutputs()
123 …+= CompareData(static_cast<int8_t *>(output->data()), calib->MutableData(), output->ElementsNum()); in CompareOutputs()
127 …= CompareData(static_cast<uint8_t *>(output->data()), calib->MutableData(), output->ElementsNum()); in CompareOutputs()
132 …= CompareData(static_cast<int32_t *>(output->data()), calib->MutableData(), output->ElementsNum()); in CompareOutputs()
Dbenchmark.cc69 printf("Elements: %d, ", tensor->ElementsNum()); in TensorToString()
77 PrintData<float>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
80 PrintData<int16_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
83 PrintData<int32_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
86 PrintData<int16_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
89 PrintData<int8_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
92 PrintData<uint8_t>(tensor->MutableData(), tensor->ElementsNum()); in TensorToString()
/third_party/mindspore/mindspore/lite/micro/coder/opcoders/nnacl/int8/
Ddetection_post_process_int8_coder.cc28 …allocator_->Malloc(kNumberTypeFloat32, input_tensors_.at(0)->ElementsNum() * sizeof(float), kWorks… in MallocInputsBuffer()
31 …allocator_->Malloc(kNumberTypeFloat32, input_tensors_.at(1)->ElementsNum() * sizeof(float), kWorks… in MallocInputsBuffer()
54 boxes_quant_param.zeroPoint, boxes->ElementsNum()); in GetInputData()
56 scores_quant_param.zeroPoint, scores->ElementsNum()); in GetInputData()
Dadd_int8_coder.cc79 support_opt_add_ = (input0->ElementsNum() == 1) || (input1->ElementsNum() == 1); in ReSize()
84 elements_num_ = output_tensor_->ElementsNum(); in ReSize()
86 arith_para_->in_elements_num0_ = input_tensors_[0]->ElementsNum(); in ReSize()
87 arith_para_->in_elements_num1_ = input_tensors_[1]->ElementsNum(); in ReSize()
88 arith_para_->out_elements_num_ = output_tensors_[0]->ElementsNum(); in ReSize()
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/fp32_grad/
Darithmetic_grad.cc44 if (dx1->ElementsNum() < dx2->ElementsNum()) { in Init()
49 } else if (dx2->ElementsNum() < dx1->ElementsNum()) { in Init()
56 tile_data0 = new (std::nothrow) float[in_tensors_.at(0)->ElementsNum()]; in Init()
61 tile_data1 = new (std::nothrow) float[in_tensors_.at(0)->ElementsNum()]; in Init()
68 tile_data2 = new (std::nothrow) float[in_tensors_.at(0)->ElementsNum()]; in Init()
246 size_t dy_size = in_tensors_.at(0)->ElementsNum(); in Execute()
247 size_t dx1_size = out_tensors_.at(0)->ElementsNum(); in Execute()
248 size_t dx2_size = out_tensors_.at(1)->ElementsNum(); in Execute()
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/int8/
Dbatchnorm_int8.cc60 CHECK_LESS_RETURN(MAX_MALLOC_SIZE, static_cast<size_t>(mean->ElementsNum()) * sizeof(float)); in InitConstTensor()
61 …alpha_addr_ = reinterpret_cast<float *>(malloc(static_cast<size_t>(mean->ElementsNum()) * sizeof(f… in InitConstTensor()
66 CHECK_LESS_RETURN(MAX_MALLOC_SIZE, static_cast<size_t>(variance->ElementsNum()) * sizeof(float)); in InitConstTensor()
67 …beta_addr_ = reinterpret_cast<float *>(malloc(static_cast<size_t>(variance->ElementsNum()) * sizeo… in InitConstTensor()
117 CHECK_LESS_RETURN(MAX_MALLOC_SIZE, static_cast<size_t>(mean->ElementsNum()) * sizeof(float)); in InitFusedConstTensor()
118 …alpha_addr_ = reinterpret_cast<float *>(malloc(static_cast<size_t>(mean->ElementsNum()) * sizeof(f… in InitFusedConstTensor()
123 CHECK_LESS_RETURN(MAX_MALLOC_SIZE, static_cast<size_t>(variance->ElementsNum()) * sizeof(float)); in InitFusedConstTensor()
124 …beta_addr_ = reinterpret_cast<float *>(malloc(static_cast<size_t>(variance->ElementsNum()) * sizeo… in InitFusedConstTensor()

12345678910>>...12