Home
last modified time | relevance | path

Searched refs:dim_size (Results 1 – 18 of 18) sorted by relevance

/third_party/mindspore/mindspore/ops/composite/multitype_ops/
D_constexpr_utils.py89 def _deep_list(array_like, dim_size=-1): argument
91 if dim_size != -1:
92 array_like = check_range(array_like, dim_size)
94 return list(map(lambda x: _deep_list(x, dim_size), array_like))
131 def check_range(x, dim_size): argument
133 if x >= dim_size or x < -dim_size:
135 x = x % dim_size
140 def make_tensor(a, dtype=mstype.int64, data_shape=None, dim_size=-1): argument
164 if dim_size != -1:
165 a = check_range(a, dim_size)
[all …]
D_compile_utils.py419 for i, (index, dim_size) in enumerate(zip(tuple_index, data_shape)):
421 int_index = const_utils.check_range(index, dim_size)
427 tensor_index = const_utils.sequence_to_index(index, dim_size)
443 slice_ele_list_index = const_utils.transform_slice_to_ele_list(index, dim_size)
500 for i, (index, dim_size) in enumerate(zip(tuple_index, data_shape)):
502 int_index = const_utils.check_range(index, dim_size)
508 tensor_index = const_utils.sequence_to_index(index, dim_size)
522 start, stop, step = const_utils.normalize_slice(index, dim_size)
525 slice_ele_list_index = const_utils.transform_slice_to_ele_list(index, dim_size)
/third_party/mindspore/mindspore/lite/micro/coder/opcoders/nnacl/fp32/
Dtranspose_fp32_coder.cc130 int *dim_size = reinterpret_cast<int *>(malloc(dims_ * sizeof(int))); in DoCode() local
131 if (dim_size == nullptr) { in DoCode()
134 *(dim_size + dims_ - 1) = 1; in DoCode()
136 *(dim_size + i - 1) = *(dim_size + i) * out_shape_[i]; in DoCode()
138 code.CodeArray("dim_size", dim_size, dims_); in DoCode()
141 free(dim_size); in DoCode()
147 free(dim_size); in DoCode()
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ir_fission/
Dreduce_min_fission.cc64 int64_t dim_size = SizeToLong(shape.size()); in CalFirstAxis() local
66 for (int64_t i = 0; i < dim_size - 1; ++i) { in CalFirstAxis()
72 if (axis_fisrt[i] < -dim_size || axis_fisrt[i] > dim_size - 1) { in CalFirstAxis()
76 axis_fisrt[i] = dim_size + axis_fisrt[i]; in CalFirstAxis()
/third_party/mindspore/mindspore/core/ir/
Dmeta_tensor.cc65 int64_t dim_size = -1; in DimensionSize() local
67 dim_size = shape_[index]; in DimensionSize()
71 return dim_size; in DimensionSize()
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/arrays/
Done_hot_gpu_kernel.h72 auto dim_size = input_shape[i]; in Init() local
74 left_dim_size_ *= dim_size; in Init()
77 right_dim_size_ *= dim_size; in Init()
/third_party/mindspore/mindspore/lite/tools/converter/parser/tf/
Dtf_model_parser.cc100 for (int i = 0; i < tensor_shape.dim_size(); i++) { in GetShapeSize()
111 for (int i = 0; i < tensor_shape.dim_size(); i++) { in SetFloatTensorInfo()
146 for (int i = 0; i < tensor_shape.dim_size(); i++) { in SetInt32TensorInfo()
181 for (int i = 0; i < tensor_shape.dim_size(); i++) { in SetInt64TensorInfo()
194 if (tensor_proto.tensor_shape().dim_size() == 0) { // scalar in SetInt64TensorInfo()
224 for (int i = 0; i < tensor_shape.dim_size(); i++) { in SetBoolTensorInfo()
251 for (int i = 0; i < tensor_shape.dim_size(); i++) { in SetStringTensorInfo()
340 auto dim_size = element_shape_proto.dim_size(); in ConvertConstVariant() local
341 std::vector<int> tensor_list_data(dim_size + 2); in ConvertConstVariant()
343 tensor_list_data[1] = element_shape_proto.dim_size(); in ConvertConstVariant()
[all …]
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/
Dgather_d_cpu_kernel.cc88 size_t dim_size = sizeof(int); in Launch() local
90 …if (inputs[0]->size != input_size || inputs[1]->size != dim_size || inputs[2]->size != index_size … in Launch()
/third_party/mindspore/mindspore/lite/src/
Dtensor.cc238 int dim_size = -1; in DimensionSize() local
240 dim_size = shape_[index]; in DimensionSize()
244 return dim_size; in DimensionSize()
/third_party/mindspore/mindspore/_extends/graph_kernel/model/
Dop_infer.py108 dim_size = max([len(shape) for shape in shapes])
109 align_shapes = [[1] * (dim_size - len(shape)) + shape for shape in shapes]
110 out_shape = [1] * dim_size
111 for i in range(dim_size):
/third_party/mindspore/mindspore/lite/tools/converter/parser/caffe/
Dcaffe_reshape_parser.cc35 for (int i = 0; i < blob_shape.dim_size(); i++) { in Parse()
Dcaffe_node_parser.cc103 for (int i = 0; i < proto.shape().dim_size(); ++i) { in ConvertShape()
Dcaffe_model_parser.cc317 for (int j = 0; j < layer.input_param().shape(0).dim_size(); j++) { in ConvertGraphInputsOfLayer()
343 for (int j = 0; j < shape.dim_size(); j++) { in ConvertGraphInputsOfShape()
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/fp32/
Dreduce_fp32.h53 int ReduceInferShape(int **in_shape, size_t *dim_size, int *out_shape, int *in_format, int *out_for…
Dreduce_fp32.c386 int ReduceInferShape(int **in_shape, size_t *dim_size, int *out_shape, int *in_format, int *out_for… in ReduceInferShape() argument
394 int rank = dim_size[0]; in ReduceInferShape()
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/
Dcommon_infer.c287 int dim_size = -1; in GetDimensionSize() local
289 dim_size = tensor->shape_[index]; in GetDimensionSize()
291 return dim_size; in GetDimensionSize()
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/strategy_checkpoint/
Dparallel_strategy_checkpoint.cc86 size_t rank_num = LongToSize(parallel_group_ranks.dim_size()); in LoadGroupInfo()
128 size_t dim_num = LongToSize(parallel_strategy.dim_size()); in Load()
/third_party/mindspore/mindspore/lite/java/native/runtime/
Dlite_session.cpp264 auto dim_size = static_cast<int>(env->GetArrayLength(array)); in Java_com_mindspore_lite_LiteSession_resize() local
266 std::vector<int> tensor_dims(dim_size); in Java_com_mindspore_lite_LiteSession_resize()
267 for (int j = 0; j < dim_size; j++) { in Java_com_mindspore_lite_LiteSession_resize()