/third_party/mindspore/mindspore/lite/src/delegate/npu/op/ |
D | convolution_base_npu.cc | 54 auto w_shape = inputs[1].Shape(); in InitWeightConst() local 75 …PackNHWCToNCHWFp32(fp32_weight_, nchw_weight_, w_shape[NHWC_N], w_shape[NHWC_H] * w_shape[NHWC_W],… in InitWeightConst() 82 …PackNHWCToNCHWFp32(origin_weight, nchw_weight_, w_shape[NHWC_N], w_shape[NHWC_H] * w_shape[NHWC_W], in InitWeightConst() 83 w_shape[NHWC_C]); in InitWeightConst() 96 …e::TensorDesc tensor_desc(ConverterToNPUShape({w_shape[NHWC_N], w_shape[NHWC_C], w_shape[NHWC_H], … in InitWeightConst()
|
/third_party/mindspore/mindspore/core/ops/ |
D | prelu.cc | 28 auto w_shape = CheckAndConvertUtils::ConvertShapePtrToShapeMap(w)[kShape]; in InferShape() local 32 …(void)CheckAndConvertUtils::CheckInteger("weight rank", SizeToLong(w_shape.size()), kEqual, w_rank… in InferShape() 33 if (w_shape[0] != x_shape[1] && w_shape[0] != 1) { in InferShape() 35 … << "while channel of input_x is " << x_shape[1] << ", weight_shape[0] is " << w_shape[0]; in InferShape()
|
D | conv2d.cc | 155 auto w_shape = w_shape_map[kShape]; in Conv2dInferShape() local 158 …(void)CheckAndConvertUtils::CheckInteger("w shape size", SizeToLong(w_shape.size()), kEqual, shape… in Conv2dInferShape() 164 CheckAndConvertUtils::CheckMinMaxShape(w_shape, &w_min_shape, &w_max_shape); in Conv2dInferShape() 166 CheckShapeAnyAndPositive(prim_name + " w_shape", w_shape); in Conv2dInferShape() 182 if ((x_shape[c_axis] != Shape::SHP_ANY) && (w_shape[c_axis] != Shape::SHP_ANY) && in Conv2dInferShape() 183 ((x_shape[c_axis] / group) != w_shape[c_axis])) { in Conv2dInferShape() 184 …MS_LOG(EXCEPTION) << "x_shape[C_in] / group must equal to w_shape[C_in] = " << w_shape[c_axis] << … in Conv2dInferShape() 188 if ((w_shape[n_axis] != Shape::SHP_ANY) && (w_shape[n_axis] != out_channel)) { in Conv2dInferShape() 189 …MS_LOG(EXCEPTION) << "w_shape[" << n_axis << "] = " << w_shape[n_axis] << " must equal to = " << o… in Conv2dInferShape() 197 if ((w_shape[h_axis] != Shape::SHP_ANY) && (w_shape[h_axis] != kernel_size[0])) { in Conv2dInferShape() [all …]
|
/third_party/mindspore/mindspore/core/abstract/ |
D | prim_nn.cc | 234 void CheckShape(const std::string &op_name, const ShapeVector &w_shape, const AbstractTensorPtr &in… in CheckShape() argument 237 CheckMinMaxShape(w_shape, &w_min_shape, &w_max_shape); in CheckShape() 238 CheckShapeAnyAndPositive(op_name + " w_shape", w_shape); in CheckShape() 261 ShapeVector w_shape = input_w->shape()->shape(); in InferImplConv2D() local 262 CheckShape(op_name, w_shape, input_w); in InferImplConv2D() 274 if ((x_shape[c_axis] != Shape::SHP_ANY) && (w_shape[c_axis] != Shape::SHP_ANY) && in InferImplConv2D() 275 ((x_shape[c_axis] / group) != w_shape[c_axis])) { in InferImplConv2D() 276 …MS_LOG(EXCEPTION) << "x_shape[C_in] / group must equal to w_shape[C_in] = " << w_shape[c_axis] << … in InferImplConv2D() 280 if ((w_shape[n_axis] != Shape::SHP_ANY) && (w_shape[n_axis] != out_channel)) { in InferImplConv2D() 281 …MS_LOG(EXCEPTION) << "w_shape[" << n_axis << "] = " << w_shape[n_axis] << " must equal to = " << o… in InferImplConv2D() [all …]
|
/third_party/mindspore/tests/st/ops/ascend/ |
D | test_lstm_op.py | 67 w_shape = self.input_s if i == 0 else (self.num_directions * self.hidden_s) 68 … w_np = np.random.uniform(-stdv, stdv, (w_shape + self.hidden_s, gate_size)).astype(np.float16) 69 … w_list_value.append(Parameter(initializer(Tensor(w_np), [w_shape + self.hidden_s, gate_size]), 79 … w_bw_np = np.random.uniform(-stdv, stdv, (w_shape + self.hidden_s, gate_size)).astype(np.float16) 80 … b_list_value.append(Parameter(initializer(Tensor(w_bw_np), [w_shape + self.hidden_s, gate_size]),
|
/third_party/mindspore/mindspore/nn/layer/ |
D | lstm.py | 183 w_shape = input_size if layer == 0 else (num_directions * hidden_size) 184 … w_np = np.random.uniform(-stdv, stdv, (w_shape + hidden_size, gate_size)).astype(np.float16) 186 … initializer(Tensor(w_np), [w_shape + hidden_size, gate_size]), name='weight_fw' + str(layer))) 193 … w_bw_np = np.random.uniform(-stdv, stdv, (w_shape + hidden_size, gate_size)).astype(np.float16) 194 … self.w_list.append(Parameter(initializer(Tensor(w_bw_np), [w_shape + hidden_size, gate_size]),
|
/third_party/mindspore/mindspore/ops/operations/ |
D | _grad_ops.py | 1248 def infer_shape(self, y_shape, dy_shape, dhy_shape, dcy_shape, w_shape, argument 1330 …def infer_shape(self, x_shape, hx_shape, cx_shape, w_shape, y_shape, hy_shape, cy_shape, dy_shape,… argument 1382 def infer_shape(self, x_shape, w_shape, b_shape, y_shape, init_h_shape, init_c_shape, h_shape, argument 1386 hidden_size = w_shape[-1] // 4 1387 if w_shape[-1] % 4 != 0: 1389 validator.check("w_shape[0]", w_shape[0], "input_size + hidden_size", 1392 validator.check("b_shape[0]", b_shape[0], "w_shape[1]", w_shape[1], Rel.EQ, self.name) 1405 return w_shape, (w_shape[1],), x_shape, dh_shape, dc_shape 1569 def infer_shape(self, y_backprop_shape, a_shape, w_shape): argument 1570 return y_backprop_shape, w_shape [all …]
|
D | nn_ops.py | 1562 def infer_shape(self, x_shape, w_shape, b_shape=None): argument 1563 validator.check_equal_int(len(w_shape), 4, "weight rank", self.name) 1565 validator.check("x_shape[1]", x_shape[1], "w_shape[1]", w_shape[1], Rel.EQ, self.name) 1566 …validator.check('kernel_size', self.kernel_size, 'w_shape[2:4]', tuple(w_shape[2:4]), Rel.EQ, self… 1568 kernel_size_n, _, kernel_size_h, kernel_size_w = w_shape 2455 def infer_shape(self, x_shape, t_shape, w_shape): argument 2458 validator.check_int(len(w_shape), 1, Rel.EQ, "weight rank", self.name) 2461 … validator.check(f"input_shape[0]", x_shape[0], "weight_shape", w_shape[0], Rel.EQ, self.name) 2463 … validator.check(f"input_shape[1]", x_shape[1], "weight_shape", w_shape[0], Rel.EQ, self.name) 3971 def infer_shape(self, x_shape, h_shape, c_shape, w_shape): argument [all …]
|
D | _quant_ops.py | 1703 def infer_shape(self, w_shape, w_min_shape, w_max_shape): argument 1704 validator.check_int(len(w_min_shape), len(w_shape), Rel.EQ, "dims of w_min", self.name) 1705 validator.check_int(len(w_max_shape), len(w_shape), Rel.EQ, "dims of w_max", self.name) 1706 return w_shape
|
/third_party/mindspore/mindspore/lite/micro/coder/opcoders/nnacl/fp32/ |
D | lstm_fp32_coder.cc | 100 std::vector<int> w_shape = weight_i->shape(); in InitParam() local 101 lstm_param_->hidden_size_ = w_shape.at(1) / 4; in InitParam()
|
/third_party/mindspore/mindspore/ops/_grad/ |
D | grad_nn_ops.py | 62 w_shape = get_shape(w) 65 if -1 in w_shape: 66 w_shape = get_dyn_shape(w) 71 dw = filter_grad(dout, x, w_shape) 1094 w_shape = get_shape(w) 1095 if -1 in w_shape: 1096 w_shape = get_dyn_shape(w) 1100 dw = filter_grad(x, dout, w_shape)
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/fp32/ |
D | gru_fp32.cc | 71 std::vector<int> w_shape = weight_g->shape(); in InitParam() local 72 gru_param_->hidden_size_ = w_shape.at(1) / gate_num; in InitParam()
|
D | lstm_fp32.cc | 170 std::vector<int> w_shape = weight_i->shape(); in InitParam() local 171 lstm_param_->hidden_size_ = w_shape.at(1) / gate_num; in InitParam()
|
/third_party/mindspore/mindspore/ops/_op_impl/_custom_op/ |
D | img2col_impl.py | 822 n_shape, c1_shape, h_shape, w_shape, c0_shape = input_x_shape 853 …output_tmp = [n_shape * int(h_shape // stride_h) * int(w_shape // stride_w), filter_h * filter_w *… 863 if tuple([h_shape, w_shape]) == (224, 224): 866 if tuple([h_shape, w_shape]) == (56, 56): 869 if tuple([h_shape, w_shape]) == (28, 28): 872 if tuple([h_shape, w_shape]) == (14, 14): 875 if tuple([h_shape, w_shape]) == (7, 7):
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/fp16/ |
D | gru_fp16.cc | 70 std::vector<int> w_shape = weight_g->shape(); in InitParam() local 71 gru_param_->hidden_size_ = w_shape.at(1) / gate_num; in InitParam()
|
D | lstm_fp16.cc | 75 std::vector<int> w_shape = weight_i->shape(); in InitParam() local 76 lstm_param_->hidden_size_ = w_shape.at(1) / gate_num; in InitParam()
|
/third_party/mindspore/mindspore/ccsrc/transform/express_ir/ |
D | onnx_exporter.cc | 1410 auto w_shape = dyn_cast<abstract::Shape>(node->input(kTwoNum)->Shape()); in ExportPrimDepthwiseConv2d() local 1412 MS_EXCEPTION_IF_NULL(w_shape); in ExportPrimDepthwiseConv2d() 1413 if (x_shape->shape().size() != kFourNum || w_shape->shape().size() != kFourNum) { in ExportPrimDepthwiseConv2d() 1416 if (w_shape->shape()[kZeroNum] != kOneNum && w_shape->shape()[kOneNum] != kOneNum) { in ExportPrimDepthwiseConv2d() 1430 tensor_proto->add_dims(static_cast<::google::protobuf::int64>(w_shape->shape().size())); in ExportPrimDepthwiseConv2d() 1433 tensor_proto->add_int64_data(w_shape->shape()[1]); in ExportPrimDepthwiseConv2d() 1434 tensor_proto->add_int64_data(w_shape->shape()[0]); in ExportPrimDepthwiseConv2d() 1435 tensor_proto->add_int64_data(w_shape->shape()[2]); in ExportPrimDepthwiseConv2d() 1436 tensor_proto->add_int64_data(w_shape->shape()[3]); in ExportPrimDepthwiseConv2d()
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/trt_pass/ |
D | trt_op_converter.cc | 541 const auto &w_shape = AnfAlgo::GetPrevNodeOutputInferShape(node, 1); in MS_TRT_CONVERTER_FUNC_REG() local 543 …context->network()->addFullyConnected(*x_reshape->getOutput(0), w_shape[0], *inputs[1].weight(), b… in MS_TRT_CONVERTER_FUNC_REG()
|
/third_party/mindspore/mindspore/ccsrc/common/ |
D | trans.cc | 672 int64_t w_shape = shape[shape.size() - kDim1]; in FracNZDeviceDynamicShape() local 674 …int64_t w1 = (w_shape == Shape::SHP_ANY) ? Shape::SHP_ANY : (w_shape - 1) / SizeToLong(kCubeSize) … in FracNZDeviceDynamicShape()
|
/third_party/mindspore/tests/ut/python/ops/ |
D | test_ops.py | 575 …def __init__(self, w_shape, out_channel, kernel_size, mode, pad_mode, pad, stride, dilation, group… argument 580 self.w_size = w_shape 1419 …'block': Conv3DBackpropFilter(w_shape=(32, 32, 4, 6, 2), out_channel=32, kernel_size=(4, 6, 2), mo…
|