/third_party/mindspore/mindspore/core/ops/ |
D | op_utils.cc | 37 std::vector<int64_t> broadcast_shape; in CalBroadCastShape() local 39 (void)std::copy(y_shape.begin(), y_shape.end() - length, std::back_inserter(broadcast_shape)); in CalBroadCastShape() 41 (void)std::copy(x_shape.begin(), x_shape.end() - length, std::back_inserter(broadcast_shape)); in CalBroadCastShape() 45 broadcast_shape.push_back(y_shape[LongToSize(y_length + i)]); in CalBroadCastShape() 47 broadcast_shape.push_back(x_shape[LongToSize(x_length + i)]); in CalBroadCastShape() 49 broadcast_shape.push_back(x_shape[LongToSize(x_length + i)]); in CalBroadCastShape() 55 return broadcast_shape; in CalBroadCastShape() 72 auto broadcast_shape = CalBroadCastShape(x_shape, y_shape, op_name); in BroadCastInferShape() local 75 …return std::make_shared<abstract::Shape>(broadcast_shape, min_broadcast_shape, max_broadcast_shape… in BroadCastInferShape()
|
D | lerp.cc | 42 auto broadcast_shape = CalBroadCastShape(start_shape, end_shape, op_name, "start", "end"); in InferShape() local 46 broadcast_shape = CalBroadCastShape(broadcast_shape, weight_shape, op_name); in InferShape() 48 return std::make_shared<abstract::Shape>(broadcast_shape); in InferShape()
|
D | masked_fill.cc | 38 auto broadcast_shape = CalBroadCastShape(input_shape, mask_shape, op_name, "input", "mask"); in InferShape() local 46 broadcast_shape = CalBroadCastShape(broadcast_shape, value_shape, op_name); in InferShape() 48 return std::make_shared<abstract::Shape>(broadcast_shape); in InferShape()
|
/third_party/mindspore/mindspore/_extends/graph_kernel/expanders/ |
D | minimum_grad.py | 64 def get_reduce_axis(original_shape, broadcast_shape): argument 66 if len(original_shape) > len(broadcast_shape): 69 tmp_shape = [1] * (len(broadcast_shape) - len(original_shape)) + original_shape 72 if tmp_shape[idx] != broadcast_shape[idx]: 76 … raise ValueError("broadcast dismatch %s vs %s" % (tmp_shape[idx], broadcast_shape[idx]))
|
/third_party/mindspore/mindspore/nn/probability/distribution/ |
D | uniform.py | 275 broadcast_shape = self.shape(prob) 276 zeros = self.fill(self.dtypeop(prob), broadcast_shape, 0.0) 323 broadcast_shape = self.shape(prob) 324 zeros = self.fill(self.dtypeop(prob), broadcast_shape, 0.0) 325 ones = self.fill(self.dtypeop(prob), broadcast_shape, 1.0) 345 broadcast_shape = self.shape(low + high) 346 origin_shape = shape + broadcast_shape
|
D | categorical.py | 294 broadcast_shape = self.shape(broadcast_shape_tensor) 295 num_classes = broadcast_shape[-1] 296 label_shape = broadcast_shape[:-1] 350 broadcast_shape = self.shape(broadcast_shape_tensor) 351 num_classes = broadcast_shape[-1] 352 label_shape = broadcast_shape[:-1]
|
D | distribution.py | 139 def broadcast_shape(self): member in Distribution 168 broadcast_shape = None 182 if broadcast_shape is None: 183 broadcast_shape = self.shape_base(arg) 186 common_dtype, broadcast_shape, 1.0) 188 broadcast_shape = self.shape_base(arg + broadcast_shape_tensor) 190 common_dtype, broadcast_shape, 1.0)
|
D | gumbel.py | 158 scale = self.scale * self.fill(self.parameter_type, self.broadcast_shape, 1.0) 168 scale = self.scale * self.fill(self.parameter_type, self.broadcast_shape, 1.0)
|
D | log_normal.py | 136 s = 'batch_shape = {}'.format(self.broadcast_shape)
|
/third_party/mindspore/mindspore/ops/composite/multitype_ops/ |
D | _compile_utils.py | 214 def _broadcast(broadcast_shape, x): argument 216 if not const_utils.check_two_shapes_need_broadcast(broadcast_shape, F.shape(x)): 218 multiples = const_utils.compute_multiples(F.shape(x), broadcast_shape) 225 def _transform_indexing_tensor(broadcast_shape, final_shape, new_shape, item): argument 227 item = _broadcast(broadcast_shape, item) 383 broadcast_shape = const_utils.generate_broadcast_shape(tensor_index_shape, op_name) 384 if 0 in broadcast_shape: 385 res_shape = broadcast_shape 391 broadcast_tensors = hyper_map(F.partial(_broadcast, broadcast_shape), tuple_index) 449 broadcast_shape, index_tensor_new_shape, final_shape, fancy_position = \ [all …]
|
D | _constexpr_utils.py | 446 broadcast_shape = shapes[0] 450 broadcast_shape = op_utils.get_broadcast_shape( 451 broadcast_shape, shape, op_name) 454 return tuple(broadcast_shape) 466 def compute_multiples(origin_shape, broadcast_shape): argument 468 len_gap = len(broadcast_shape) - len(origin_shape) 469 …return broadcast_shape[0:len_gap] + tuple(map(lambda x, y: x // y, broadcast_shape[len_gap:], orig… 514 broadcast_shape = generate_broadcast_shape(tensor_indexes_shapes, op_name) 516 final_shape = slice_shapes[:fancy_position] + broadcast_shape + slice_shapes[fancy_position:] 518 broadcast_shape + (1,) * len(slice_shapes[fancy_position:]) [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ir_fission/ |
D | cdist_fission.cc | 40 std::vector<size_t> broadcast_shape; in CalCdistBroadCastShape() local 41 …std::copy(x_shape.begin(), x_shape.end() - SizeToLong(length), std::back_inserter(broadcast_shape)… in CalCdistBroadCastShape() 44 broadcast_shape.push_back(y_shape[length - i]); in CalCdistBroadCastShape() 46 broadcast_shape.push_back(x_shape[length - i]); in CalCdistBroadCastShape() 48 broadcast_shape.push_back(x_shape[length - i]); in CalCdistBroadCastShape() 54 return broadcast_shape; in CalCdistBroadCastShape()
|
/third_party/mindspore/mindspore/ops/operations/ |
D | random_ops.py | 198 broadcast_shape = get_broadcast_shape(alpha['shape'], beta['shape'], self.name) 199 broadcast_shape = get_broadcast_shape(broadcast_shape, shape_v, self.name) 201 'shape': broadcast_shape, 261 broadcast_shape = get_broadcast_shape(mean['shape'], shape_v, self.name) 263 'shape': broadcast_shape,
|
/third_party/mindspore/mindspore/ops/_utils/ |
D | utils.py | 74 broadcast_shape = list(broadcast_shape_front) + broadcast_shape_back 75 return broadcast_shape
|
/third_party/mindspore/mindspore/core/abstract/ |
D | utils.cc | 240 ShapeVector broadcast_shape; in RealBroadcast() local 257 broadcast_shape.push_back(output_i); in RealBroadcast() 259 std::reverse(broadcast_shape.begin(), broadcast_shape.end()); in RealBroadcast() 260 return broadcast_shape; in RealBroadcast()
|
D | prim_arrays.cc | 1144 auto broadcast_shape = BroadcastShape(x_shape->shape(), mask_shape->shape()); in InferImplMaskedSelect() local 1147 …int64_t max_size = std::accumulate(broadcast_shape.begin(), broadcast_shape.end(), 1, std::multipl… in InferImplMaskedSelect()
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/ |
D | cpu_kernel.cc | 359 std::vector<size_t> broadcast_shape; in GetBroadcastShape() local 372 broadcast_shape.push_back(y[i]); in GetBroadcastShape() 376 broadcast_shape.push_back(x[i]); in GetBroadcastShape() 380 broadcast_shape.push_back(broadcast_shape_back[i]); in GetBroadcastShape() 382 return broadcast_shape; in GetBroadcastShape()
|
/third_party/mindspore/mindspore/_extends/graph_kernel/model/ |
D | op_infer.py | 106 def broadcast_shape(shapes): member in _Elemwise 149 return self.broadcast_shape([op_input.shape for op_input in self.inputs]) 157 return self.broadcast_shape(nz_shapes)
|
/third_party/mindspore/tests/ut/cpp/pipeline/static_analysis/ |
D | prim_test.cc | 335 PrimitivePtr broadcast_shape = std::make_shared<Primitive>("broadcast_shape"); in TEST_F() local 336 FuncGraphPtr func_graph = MakeFuncGraph(broadcast_shape, 2); in TEST_F()
|
/third_party/mindspore/mindspore/ops/_grad/ |
D | grad_array_ops.py | 1034 broadcast_shape = shape_op(out) 1038 _, reduction_axes = broadcast_gradient_args(broadcast_shape, x_shape)
|