Home
last modified time | relevance | path

Searched refs:weight_tensor (Results 1 – 25 of 49) sorted by relevance

12

/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/fp32/
Dconvolution_depthwise_fp32.cc29 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
30 CHECK_NULL_RETURN(weight_tensor); in Init()
31 … int pack_weight_size = weight_tensor->Batch() * weight_tensor->Height() * weight_tensor->Width(); in Init()
101 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
102 void *origin_weight = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
105 weight_tensor->Height() * weight_tensor->Width(), weight_tensor->Batch()); in PackWeight()
109 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
110 int channel = weight_tensor->Batch(); in MallocWeightBiasData()
111 int pack_weight_size = weight_tensor->Batch() * weight_tensor->Height() * weight_tensor->Width(); in MallocWeightBiasData()
Dconvolution_depthwise_indirect_fp32.cc40 auto weight_tensor = in_tensors_[kWeightIndex]; in Init() local
41 CHECK_NULL_RETURN(weight_tensor); in Init()
47 int batch_flag = UP_DIV(weight_tensor->Batch(), div_flag); in Init()
48 int pack_weight_size = div_flag * batch_flag * weight_tensor->Height() * weight_tensor->Width(); in Init()
177 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
178 void *origin_weight = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
182weight_tensor->Height(), weight_tensor->Width(), weight_tensor->Batch()); in PackWeight()
185weight_tensor->Height(), weight_tensor->Width(), weight_tensor->Batch()); in PackWeight()
190 auto weight_tensor = in_tensors_[kWeightIndex]; in MallocWeightBiasData() local
196 int batch_flag = UP_DIV(weight_tensor->Batch(), div_flag); in MallocWeightBiasData()
[all …]
Dconvolution_depthwise_slidewindow_x86_fp32.cc67 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
68 int oc_algin = UP_DIV(weight_tensor->Batch(), oc_tile_); in Init()
69 int pack_weight_size = oc_algin * oc_tile_ * weight_tensor->Height() * weight_tensor->Width(); in Init()
168 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
169 int oc_algin = UP_DIV(weight_tensor->Batch(), oc_tile_); in PackWeight()
170 void *origin_weight = IsTrainable() ? weight_tensor->data() : origin_weight_; in PackWeight()
172 …PackNHWCToNXHWCXFp32(weight_tensor->Height(), weight_tensor->Width(), weight_tensor->Batch(), oc_a… in PackWeight()
173 weight_tensor->Channel(), reinterpret_cast<float *>(packed_weight_), in PackWeight()
178 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
179 int oc_algin = UP_DIV(weight_tensor->Batch(), oc_tile_); in MallocWeightBiasData()
[all …]
Dconvolution_depthwise_slidewindow_fp32.cc63 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
64 int OC4 = UP_DIV(weight_tensor->Batch(), C4NUM); in Init()
65 int pack_weight_size = C4NUM * OC4 * weight_tensor->Height() * weight_tensor->Width(); in Init()
164 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
165 void *origin_weight = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
168 weight_tensor->Height() * weight_tensor->Width(), weight_tensor->Batch()); in PackWeight()
172 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
173 int OC4 = UP_DIV(weight_tensor->Batch(), C4NUM); in MallocWeightBiasData()
174 int pack_weight_size = C4NUM * OC4 * weight_tensor->Height() * weight_tensor->Width(); in MallocWeightBiasData()
Ddeconvolution_depthwise_fp32.cc81 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
82 int OC4 = UP_DIV(weight_tensor->Batch(), C4NUM); in Init()
83 int pack_weight_size = C4NUM * OC4 * weight_tensor->Height() * weight_tensor->Width(); in Init()
190 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
191 int OC4 = UP_DIV(weight_tensor->Batch(), C4NUM); in MallocWeightBiasData()
192 int pack_weight_size = C4NUM * OC4 * weight_tensor->Height() * weight_tensor->Width(); in MallocWeightBiasData()
212 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
213 void *origin_weight = IsTrainable() ? weight_tensor->data() : origin_weight_; in PackWeight()
216 weight_tensor->Height() * weight_tensor->Width(), weight_tensor->Batch()); in PackWeight()
Ddeconvolution_fp32.cc57 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
58 auto input_channel = weight_tensor->Batch(); in MallocWeightBiasData()
59 auto output_channel = weight_tensor->Channel(); in MallocWeightBiasData()
60 auto kernel_h_ = weight_tensor->Height(); in MallocWeightBiasData()
61 auto kernel_w_ = weight_tensor->Width(); in MallocWeightBiasData()
82 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
83 auto input_channel = weight_tensor->Batch(); in PackWeight()
84 auto output_channel = weight_tensor->Channel(); in PackWeight()
85 auto kernel_h = weight_tensor->Height(); in PackWeight()
86 auto kernel_w = weight_tensor->Width(); in PackWeight()
[all …]
Dconvolution_depthwise_3x3_fp32.cc31 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
32 CHECK_NULL_RETURN(weight_tensor); in Init()
33 int channel = weight_tensor->Batch(); in Init()
116 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
117 int channel = weight_tensor->Batch(); in PackWeight()
118 void *origin_weight = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
124 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
125 int channel = weight_tensor->Batch(); in MallocWeightBiasData()
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/fp16/
Dconvolution_depthwise_fp16.cc27 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
28 void *origin_weight = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
31weight_tensor->Height() * weight_tensor->Width(), weight_tensor->Batch(), 0, 0); in PackWeight()
35 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
36 int channel = weight_tensor->Batch(); in MallocWeightBiasData()
37 int pack_weight_size = channel * weight_tensor->Height() * weight_tensor->Width(); in MallocWeightBiasData()
63 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
64 CHECK_NULL_RETURN(weight_tensor); in Init()
65 int channel = weight_tensor->Batch(); in Init()
66 int pack_weight_size = channel * weight_tensor->Height() * weight_tensor->Width(); in Init()
Dconvolution_depthwise_slidewindow_fp16.cc58 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
59 void *origin_weight = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
62 … 1, weight_tensor->Height() * weight_tensor->Width(), weight_tensor->Batch()); in PackWeight()
66 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
67 int OC8 = UP_DIV(weight_tensor->Batch(), C8NUM); in MallocWeightBiasData()
68 int pack_weight_size = C8NUM * OC8 * weight_tensor->Height() * weight_tensor->Width(); in MallocWeightBiasData()
99 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
100 CHECK_NULL_RETURN(weight_tensor); in Init()
101 int OC8 = UP_DIV(weight_tensor->Batch(), C8NUM); in Init()
102 int pack_weight_size = C8NUM * OC8 * weight_tensor->Height() * weight_tensor->Width(); in Init()
Ddeconvolution_depthwise_fp16.cc72 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
73 int OC8 = UP_DIV(weight_tensor->Batch(), C8NUM); in MallocWeightBiasData()
74 int pack_weight_size = C8NUM * OC8 * weight_tensor->Height() * weight_tensor->Width(); in MallocWeightBiasData()
95 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
96 void *origin_weight = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
99 … 1, weight_tensor->Height() * weight_tensor->Width(), weight_tensor->Batch()); in PackWeight()
109 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
110 int OC8 = UP_DIV(weight_tensor->Batch(), C8NUM); in Init()
111 int pack_weight_size = C8NUM * OC8 * weight_tensor->Height() * weight_tensor->Width(); in Init()
Ddeconvolution_fp16.cc57 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
58 auto input_channel = weight_tensor->Batch(); in PackWeight()
59 auto output_channel = weight_tensor->Channel(); in PackWeight()
60 auto kernel_h = weight_tensor->Height(); in PackWeight()
61 auto kernel_w = weight_tensor->Width(); in PackWeight()
62 void *origin_weight = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
69 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
70 auto input_channel = weight_tensor->Batch(); in MallocWeightBiasData()
71 auto output_channel = weight_tensor->Channel(); in MallocWeightBiasData()
72 auto kernel_h = weight_tensor->Height(); in MallocWeightBiasData()
[all …]
Dconvolution_depthwise_3x3_fp16.cc30 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
31 int channel = weight_tensor->Batch(); in PackWeight()
32 void *origin_weight = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
39 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
40 int channel = weight_tensor->Batch(); in MallocWeightBiasData()
69 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
70 CHECK_NULL_RETURN(weight_tensor); in Init()
71 int channel = weight_tensor->Batch(); in Init()
Dconvolution_winograd_fp16.cc36 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
37 int in_channel = weight_tensor->Channel(); in MallocWeightBiasData()
38 int out_channel = weight_tensor->Batch(); in MallocWeightBiasData()
82 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
83 void *weight_origin = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
151 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
152 CHECK_NULL_RETURN(weight_tensor); in Init()
153 int in_channel = weight_tensor->Channel(); in Init()
154 int out_channel = weight_tensor->Batch(); in Init()
Dconvolution_1x1_fp16.cc84 auto weight_tensor = in_tensors_.at(kWeightIndex); in MallocWeightBiasData() local
85 auto input_channel = weight_tensor->Channel(); in MallocWeightBiasData()
86 auto output_channel = weight_tensor->Batch(); in MallocWeightBiasData()
115 auto weight_tensor = in_tensors_.at(kWeightIndex); in PackWeight() local
116 auto input_channel = weight_tensor->Channel(); in PackWeight()
117 auto output_channel = weight_tensor->Batch(); in PackWeight()
118 void *weight_origin = (op_parameter_->is_train_session_) ? weight_tensor->data() : origin_weight_; in PackWeight()
151 auto weight_tensor = in_tensors_.at(kWeightIndex); in Init() local
152 CHECK_NULL_RETURN(weight_tensor); in Init()
153 auto input_channel = weight_tensor->Channel(); in Init()
[all …]
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/int8/
Dconvolution_depthwise_int8.cc35 auto weight_tensor = in_tensors_.at(kWeightIndex); in InitWeightBias() local
36 CHECK_NULL_RETURN(weight_tensor); in InitWeightBias()
37 auto origin_weight = reinterpret_cast<int8_t *>(weight_tensor->MutableData()); in InitWeightBias()
39 int channel = weight_tensor->Batch(); in InitWeightBias()
40 int pack_weight_size = channel * weight_tensor->Height() * weight_tensor->Width(); in InitWeightBias()
50 PackNCHWToNHWCInt8(origin_weight, tmp_weight, 1, weight_tensor->Height() * weight_tensor->Width(), in InitWeightBias()
51 weight_tensor->Batch()); in InitWeightBias()
62 for (int i = 0; i < weight_tensor->Height() * weight_tensor->Width(); i++) { in InitWeightBias()
70 if (weight_tensor->ElementsNum() > pack_weight_size) { in InitWeightBias()
75 for (int i = 0; i < weight_tensor->ElementsNum(); i++) { in InitWeightBias()
Dconvolution_depthwise_3x3_int8.cc44 auto weight_tensor = in_tensors_.at(kWeightIndex); in InitWeightBias() local
45 CHECK_NULL_RETURN(weight_tensor); in InitWeightBias()
46 auto origin_weight = reinterpret_cast<int8_t *>(weight_tensor->MutableData()); in InitWeightBias()
48 int channel = weight_tensor->Batch(); in InitWeightBias()
57 int pack_weight_size = channel * weight_tensor->Height() * weight_tensor->Width(); in InitWeightBias()
63 PackNCHWToNHWCInt8(origin_weight, tmp_weight, 1, weight_tensor->Height() * weight_tensor->Width(), in InitWeightBias()
64 weight_tensor->Batch()); in InitWeightBias()
74 for (int i = 0; i < weight_tensor->Height() * weight_tensor->Width(); i++) { in InitWeightBias()
82 if (weight_tensor->ElementsNum() > pack_weight_size) { in InitWeightBias()
87 for (int i = 0; i < weight_tensor->ElementsNum(); i++) { in InitWeightBias()
Dconvolution_depthwise_slidewindow_int8.cc41 auto weight_tensor = in_tensors_.at(kWeightIndex); in InitWeightBias() local
42 CHECK_NULL_RETURN(weight_tensor); in InitWeightBias()
43 auto origin_weight = reinterpret_cast<int8_t *>(weight_tensor->MutableData()); in InitWeightBias()
45 int OC8 = UP_DIV(weight_tensor->Batch(), C8NUM); in InitWeightBias()
46 int pack_weight_size = C8NUM * OC8 * weight_tensor->Height() * weight_tensor->Width(); in InitWeightBias()
53 …PackDepthwiseInt8Weight(origin_weight, packed_weight_, weight_tensor->Height() * weight_tensor->Wi… in InitWeightBias()
54 weight_tensor->Batch(), &(conv_param_->conv_quant_arg_)); in InitWeightBias()
222 auto weight_tensor = in_tensors_.at(kWeightIndex); in ReinitQuantParam() local
223 if (weight_tensor->quant_params().size() == kPerTensor) { in ReinitQuantParam()
225 auto weight_quant_arg = weight_tensor->quant_params().front(); in ReinitQuantParam()
[all …]
Ddeconvolution_int8.cc144 auto weight_tensor = in_tensors_.at(1); in InitBiasWeight() local
145 size_t size = UP_ROUND(weight_tensor->Channel(), C4NUM) * sizeof(int32_t); in InitBiasWeight()
160 …size_t weight_col_size = UP_ROUND(weight_tensor->Channel(), C4NUM) * weight_tensor->Height() * wei… in InitBiasWeight()
161 size_t weight_row_size = UP_ROUND(weight_tensor->Batch(), C16NUM); in InitBiasWeight()
170 …DeConvWeightTransInt8(reinterpret_cast<int8_t *>(weight_tensor->data()), weight_ptr_, weight_tenso… in InitBiasWeight()
171weight_tensor->Channel(), weight_tensor->Height() * weight_tensor->Width(), support_optimize_); in InitBiasWeight()
180 … conv_param_->conv_quant_arg_.filter_quant_args_[0].zp_, weight_tensor->Batch(), weight_col_size, in InitBiasWeight()
Ddeconvolution_depthwise_int8.cc40 auto weight_tensor = in_tensors_.at(kWeightIndex); in InitWeightBias() local
41 CHECK_NULL_RETURN(weight_tensor); in InitWeightBias()
42 auto origin_weight = reinterpret_cast<int8_t *>(weight_tensor->data()); in InitWeightBias()
48 int OC4 = UP_DIV(weight_tensor->Batch(), C4NUM); in InitWeightBias()
49 int pack_weight_size = C4NUM * OC4 * weight_tensor->Height() * weight_tensor->Width(); in InitWeightBias()
55 …DeconvDepthwiseInt8Weight(origin_weight, packed_weight_, weight_tensor->Height() * weight_tensor->… in InitWeightBias()
56 weight_tensor->Batch(), &(conv_param_->conv_quant_arg_)); in InitWeightBias()
/third_party/mindspore/mindspore/lite/src/runtime/kernel/opencl/kernel/
Dprelu.cc37 auto weight_tensor = in_tensors_.at(1); in InitWeights() local
39 if (weight_tensor->data_type() == kNumberTypeFloat16) { in InitWeights()
40 weight_scalar_ = static_cast<float>(*reinterpret_cast<float16_t *>(weight_tensor->data())); in InitWeights()
42 weight_scalar_ = *reinterpret_cast<float *>(weight_tensor->data()); in InitWeights()
46 int C_ = weight_tensor->ElementsNum(); in InitWeights()
59 if (weight_tensor->data_type() == kNumberTypeFloat16) { in InitWeights()
61 memcpy(weight_vector_, weight_tensor->data(), C_ * sizeof_FLT); in InitWeights()
64 auto origin_bias_fp16 = reinterpret_cast<float16_t *>(weight_tensor->data()); in InitWeights()
72 auto origin_bias_fp32 = reinterpret_cast<float *>(weight_tensor->data()); in InitWeights()
77 memcpy(weight_vector_, weight_tensor->data(), C_ * sizeof_FLT); in InitWeights()
[all …]
Dsparse_to_dense.cc59 auto weight_tensor = in_tensors_[2]; in InitWeights() local
61 for (int i = 0; i < weight_tensor->shape().size(); ++i) { in InitWeights()
62 size *= weight_tensor->shape()[i]; in InitWeights()
64 MS_ASSERT(weight_tensor->data()); in InitWeights()
66 if (weight_tensor->data_type() == kNumberTypeFloat16) { in InitWeights()
67 weight_scalar_ = static_cast<float>(*reinterpret_cast<float16_t *>(weight_tensor->data())); in InitWeights()
69 weight_scalar_ = *reinterpret_cast<float *>(weight_tensor->data()); in InitWeights()
84 if (weight_tensor->data_type() == kNumberTypeFloat16) { in InitWeights()
86 memcpy(weight_vector_, weight_tensor->data(), size * sizeof_FLT); in InitWeights()
89 auto origin_bias_fp16 = reinterpret_cast<float16_t *>(weight_tensor->data()); in InitWeights()
[all …]
/third_party/mindspore/mindspore/lite/tools/optimizer/fusion/
Dconv_transform_fusion.cc69 … const tensor::TensorPtr &weight_tensor, int64_t group, int kernel_num) { in GenerateNewWeightConv2DTranspose() argument
70 MS_ASSERT(dst_weight != nullptr && scale_weight != nullptr && weight_tensor != nullptr); in GenerateNewWeightConv2DTranspose()
74 MS_ASSERT(weight_tensor->data_c() != nullptr); in GenerateNewWeightConv2DTranspose()
75 auto weight_data = reinterpret_cast<float *>(weight_tensor->data_c()); in GenerateNewWeightConv2DTranspose()
76 auto cin_group = weight_tensor->shape()[0] / group; in GenerateNewWeightConv2DTranspose()
77 …int64_t area_size = weight_tensor->shape()[kInputIndexTwo] * weight_tensor->shape()[kInputIndexTwo… in GenerateNewWeightConv2DTranspose()
202 auto weight_tensor = std::dynamic_pointer_cast<tensor::Tensor>(conv_weight_param); in GenNewConvTensor() local
208 …auto new_weight_tensor = lite::CreateTensorInfo(weight_tensor->data_c(), weight_tensor->DataSize()… in GenNewConvTensor()
209weight_tensor->shape(), weight_tensor->data_type()); in GenNewConvTensor()
245 auto bias_node = AddNewBiasNode(bias_data, func_graph, kernel_num, weight_tensor->data_type()); in GenNewConvTensor()
[all …]
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/
Dconv2d_infer.c80 const TensorC *weight_tensor = inputs[1]; in Conv2dInferShape() local
87 param->group_ = weight_tensor->shape_[0]; in Conv2dInferShape()
89 param->output_channel_ = weight_tensor->shape_[0]; in Conv2dInferShape()
106 …if (input_c != weight_tensor->shape_[3] && input_c != 1 && (input_c / param->group_) != weight_ten… in Conv2dInferShape()
113 param->kernel_h_ = param->kernel_h_ != -1 ? param->kernel_h_ : weight_tensor->shape_[1]; in Conv2dInferShape()
114 param->kernel_w_ = param->kernel_w_ != -1 ? param->kernel_w_ : weight_tensor->shape_[2]; in Conv2dInferShape()
125 out_shape[3] = GetBatch(weight_tensor); in Conv2dInferShape()
/third_party/mindspore/mindspore/lite/tools/optimizer/graph/
Dconv1d_weight_expanding_pass.cc29 auto weight_tensor = GetTensorInfo(weight_node); in ExpandFilterShape() local
30 if (weight_tensor == nullptr) { in ExpandFilterShape()
34 auto shape = weight_tensor->shape(); in ExpandFilterShape()
54 weight_tensor->set_shape(new_shape); in ExpandFilterShape()
60 auto type = weight_tensor->data_type(); in ExpandFilterShape()
/third_party/mindspore/mindspore/lite/tools/converter/parser/
Dconv1d_inout_adjust.cc68 auto weight_tensor = opt::GetTensorInfo(weight_node); in ExpandFilterShape() local
69 MS_CHECK_TRUE_MSG(weight_tensor != nullptr, lite::RET_ERROR, "weight node must be param value."); in ExpandFilterShape()
70 auto shape = weight_tensor->shape(); in ExpandFilterShape()
86 (void)weight_tensor->set_shape(new_shape); in ExpandFilterShape()
92 auto type = weight_tensor->data_type(); in ExpandFilterShape()
143 auto weight_tensor = opt::GetTensorInfo(weight_node); in Run() local
144 if (weight_tensor == nullptr) { in Run()

12