/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/arrays/ |
D | slice_gpu_kernel.h | 47 size_t input_rank = input_shape_.size(); in Launch() 50 …Slice1DKernel(begin_[0], size_[0], input_shape_[0], input, output, reinterpret_cast<cudaStream_t>(… in Launch() 53 …Slice2DKernel(begin_[0], begin_[1], size_[0], size_[1], input_shape_[0], input_shape_[1], input, o… in Launch() 57 …el(begin_[0], begin_[1], begin_[2], size_[0], size_[1], size_[2], input_shape_[0], input_shape_[1], in Launch() 58 input_shape_[2], input, output, reinterpret_cast<cudaStream_t>(stream_ptr)); in Launch() 62 … input_shape_[0], input_shape_[1], input_shape_[2], input_shape_[3], input, output, in Launch() 67 … size_[4], input_shape_[0], input_shape_[1], input_shape_[2], input_shape_[3], input_shape_[4], in Launch() 72 … size_[3], size_[4], size_[5], input_shape_[0], input_shape_[1], input_shape_[2], input_shape_[3], in Launch() 73 … input_shape_[4], input_shape_[5], input, output, reinterpret_cast<cudaStream_t>(stream_ptr)); in Launch() 77 … size_[2], size_[3], size_[4], size_[5], size_[6], input_shape_[0], input_shape_[1], in Launch() [all …]
|
D | in_top_k_gpu_kernel.h | 83 …(casted_float32_input, targets_device, output_device, top_k_output_device_float32, input_shape_[0], in Launch() 84 input_shape_[1], k_, reinterpret_cast<cudaStream_t>(stream_ptr)); in Launch() 90 … CalInTopK(predictions_device, targets_device, output_device, top_k_output_device, input_shape_[0], in Launch() 91 input_shape_[1], k_, reinterpret_cast<cudaStream_t>(stream_ptr)); in Launch() 111 input_shape_ = AnfAlgo::GetInputDeviceShape(kernel_node, 0); in Init() 112 if (input_shape_.size() < 2) { in Init() 114 << input_shape_.size(); in Init() 116 is_null_input_ = CHECK_NULL_INPUT(input_shape_); in Init() 122 input_rank_ = input_shape_.size(); in Init() 125 input_size_ *= input_shape_[i]; in Init() [all …]
|
D | slice_grad_gpu_kernel.h | 48 …egin_[0], begin_[1], begin_[2], begin_[3], size_[0], size_[1], size_[2], size_[3], input_shape_[0], in Launch() 49 input_shape_[1], input_shape_[2], input_shape_[3], dy, dx, in Launch() 64 input_shape_.push_back(static_cast<size_t>(x)); in Init() 66 for (auto i = input_shape_.size(); i < 4; i++) { in Init() 67 (void)input_shape_.insert(input_shape_.begin(), 1); in Init() 82 ShapeNdTo4d(input_shape, &input_shape_); in Init() 95 input_size_ = input_shape_[0] * input_shape_[1] * input_shape_[2] * input_shape_[3] * sizeof(T); in Init() 124 if (begin_[i] < 0 && i < input_shape_.size()) { in CalcBeginAndSize() 125 begin_[i] = begin_[i] + input_shape_[i]; in CalcBeginAndSize() 129 if (size_[i] < 0 && i < input_shape_.size()) { in CalcBeginAndSize() [all …]
|
D | tensor_copy_slices_gpu_kernel.h | 74 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in Init() 76 is_null_input_ = CHECK_NULL_INPUT(input_shape_) || CHECK_NULL_INPUT(update_shape); in Init() 82 if (input_shape_.size() > kMaxDims) { in Init() 84 << input_shape_.size(); in Init() 92 if (begin_.size() > input_shape_.size()) { in Init() 95 << ", the rank of input: " << input_shape_.size(); in Init() 100 output_shape_ = input_shape_; in Init() 129 for (size_t i = 0; i < input_shape_.size(); i++) { in GetSize() 130 input_size_ *= input_shape_[i]; in GetSize() 153 int64_t dim = input_shape_[i]; in FillEmptyDims() [all …]
|
D | broadcast_to_gpu_kernel.h | 46 …BroadcastTo(input_shape_[0], input_shape_[1], input_shape_[2], input_shape_[3], output_shape_[0], … in Launch() 70 input_shape_[i + offset] = input_shapes[i]; in Init() 83 …input_size_list_.push_back(input_shape_[0] * input_shape_[1] * input_shape_[2] * input_shape_[3] *… in InitSizeLists() 88 size_t input_shape_[4] = {1, 1, 1, 1};
|
D | tile_gpu_kernel.h | 48 … cudaMemcpyAsync(input_shape_ptr, &input_shape_[0], input_shape_.size() * sizeof(size_t), in Launch() 71 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in Init() 73 is_null_input_ = CHECK_NULL_INPUT(input_shape_) || CHECK_NULL_INPUT(output_shape_); in Init() 84 for (size_t i = 0; i < input_shape_.size(); i++) { in Init() 85 input_size_ *= input_shape_[i]; in Init() 98 …filling_value = static_cast<int64_t>(multiples.size()) - static_cast<int64_t>(input_shape_.size()); in Init() 100 (void)input_shape_.insert(input_shape_.begin(), LongToSize(filling_value), 1); in Init() 110 input_shape_.clear(); in ResetResource() 120 workspace_size_list_.push_back(input_shape_.size() * sizeof(size_t)); in InitSizeLists() 130 std::vector<size_t> input_shape_; variable
|
D | strided_slice_gpu_kernel.h | 47 StridedSlice(input_shape_, begin_, strides_, output_shape_, input, output, in Launch() 53 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in Init() 54 null_output_ = CHECK_NULL_INPUT(input_shape_); in Init() 60 if (input_shape_.size() > MAX_DIMS) { in Init() 62 << input_shape_.size(); in Init() 74 for (size_t i = 0; i < input_shape_.size(); i++) { in InitSizeLists() 75 size *= input_shape_[i]; in InitSizeLists()
|
D | reverse_sequence_gpu_kernel.h | 60 … cudaMemcpyAsync(input_shape_ptr, &input_shape_[0], input_shape_.size() * sizeof(size_t), in Launch() 81 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in Init() 83 is_null_input_ = CHECK_NULL_INPUT(input_shape_) || CHECK_NULL_INPUT(seq_len_shape); in Init() 89 if (input_shape_.size() < 1) { in Init() 91 << input_shape_.size(); in Init() 94 shape_size_ = input_shape_.size(); // required for calls in Init() 96 input_size_ *= input_shape_[i]; in Init() 128 std::vector<size_t> input_shape_; variable
|
D | strided_slice_gpu_common.h | 47 if (i >= input_shape_.size()) { in FillEmptyDims() 48 input_shape_.push_back(1); in FillEmptyDims() 52 int64_t dim = input_shape_[i]; in FillEmptyDims() 59 int64_t dim = input_shape_[i]; in FillEmptyDims() 62 end_.push_back(i < input_shape_.size() ? input_shape_[i] : 1); in FillEmptyDims() 84 end_[j] = input_shape_[j]; in ParseMasks() 93 end_[k] = input_shape_[k]; in ParseMasks() 103 end_[l] = input_shape_[l]; in ParseMasks() 158 std::vector<size_t> input_shape_; variable
|
D | resize_nearest_neighbor_grad_gpu_kernel.h | 51 float h_scale = Scaling(output_shape_[2], input_shape_[2], align_corners_); in Launch() 52 float w_scale = Scaling(output_shape_[3], input_shape_[3], align_corners_); in Launch() 53 …ResizeNearestNeighborGrad(input_size, input, input_shape_[0], input_shape_[1], input_shape_[2], in… in Launch() 95 input_shape_.push_back(input_shape[i]); in Init() 128 std::vector<int> input_shape_; variable
|
D | resize_nearest_neighbor_gpu_kernel.h | 51 float h_scale = Scaling(input_shape_[2], output_shape_[2], align_corners_); in Launch() 52 float w_scale = Scaling(input_shape_[3], output_shape_[3], align_corners_); in Launch() 53 …CalResizeNearestNeighbor(size, input, input_shape_[0], input_shape_[1], input_shape_[2], input_sha… in Launch() 91 input_shape_.push_back(input_shape[i]); in Init() 120 std::vector<int> input_shape_; variable
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/ |
D | bias_add_cpu_kernel.cc | 33 input_shape_ = AnfAlgo::GetInputDeviceShape(kernel_node, 0); in InitKernel() 35 data_shape_ = input_shape_.size(); in InitKernel() 36 if (input_shape_.size() < kBiasAddMinDim || input_shape_.size() > kBiasAddMaxDim) { in InitKernel() 39 << input_shape_.size(); in InitKernel() 44 if (input_shape_[1] != bias_shape_[0]) { in InitKernel() 46 << input_shape_[1] << "]"; in InitKernel() 58 if (input_shape_.size() > 2) { in Launch() 60 for (size_t i = 2; i < input_shape_.size(); ++i) { in Launch() 61 hw_size *= input_shape_[i]; in Launch() 64 size_t c_size = input_shape_[1]; in Launch() [all …]
|
D | bias_add_grad_cpu_kernel.cc | 31 input_shape_ = AnfAlgo::GetInputDeviceShape(kernel_node, 0); in InitKernel() 32 if (input_shape_.size() < 2) { in InitKernel() 34 << input_shape_.size(); in InitKernel() 45 if (input_shape_.size() > 2) { in Launch() 47 for (size_t i = 2; i < input_shape_.size(); ++i) { in Launch() 48 hw_size *= input_shape_[i]; in Launch() 51 size_t c_size = input_shape_[1]; in Launch() 54 for (size_t n = 0; n < input_shape_[0]; ++n) { in Launch() 61 } else if (input_shape_.size() == 2) { in Launch() 64 …ReduceSumDim2Axis0(end - start, input_shape_[1], input_shape_[0], input_addr + start, output_addr … in Launch() [all …]
|
D | split_cpu_kernel.cc | 38 (void)std::transform(input_shape.begin(), input_shape.end(), std::back_inserter(input_shape_), in InitKernel() 40 if (input_shape_.size() < 1 || input_shape_.size() > SPLIT_STRIDES_SIZE) { in InitKernel() 42 << input_shape_.size(); in InitKernel() 68 param.strides_[input_shape_.size() - 1] = 1; in LaunchSplit() 69 for (int i = SizeToInt(input_shape_.size()) - 2; i >= 0; i--) { // from -2 to 0 dim in LaunchSplit() 70 param.strides_[i] = param.strides_[i + 1] * input_shape_[i + 1]; in LaunchSplit() 74 int split_size = input_shape_[param.split_dim_] / SizeToInt(output_num_); in LaunchSplit() 80 param.split_count_ *= input_shape_[i]; in LaunchSplit() 83 …(void)DoSplit(input, reinterpret_cast<void **>(output), &input_shape_[0], SizeToInt(start), SizeTo… in LaunchSplit() 106 int64_t dims = SizeToLong(input_shape_.size()); in CheckParam() [all …]
|
D | broadcast_to_cpu_kernel.cc | 31 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in InitKernel() 33 size_t input_shape_size = input_shape_.size(); in InitKernel() 36 MS_LOG(EXCEPTION) << "Cannot broadcast input tensor with shape " << input_shape_ in InitKernel() 40 …MS_LOG(EXCEPTION) << "Cannot broadcast input tensor with shape " << input_shape_ << " to a shape "… in InitKernel() 45 if (input_shape_[i] != output_shape_[i + offset] && input_shape_[i] != 1) { in InitKernel() 46 … MS_LOG(EXCEPTION) << "Cannot broadcast input tensor with shape " << input_shape_ << " to a shape " in InitKernel() 52 shape_info_.input_shape_[i] = SizeToInt(input_shape_[i]); in InitKernel() 80 …MS_LOG(EXCEPTION) << "Broadcast tensor with shape " << input_shape_ << " to shape " << output_shap… in Launch()
|
D | stridedslice_cpu_kernel.cc | 46 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in InitKernel() 48 if (input_shape_.size() > DIMENSION_8D || input_shape_.empty()) { in InitKernel() 49 …ION) << "StridedSlice only support 1D to 8D input tensor, but got " << input_shape_.size() << "D."; in InitKernel() 55 …if (begin.size() != end.size() || begin.size() != stride.size() || begin.size() > input_shape_.siz… in InitKernel() 77 if (input_shape_.size() == output_shape_.size()) { in MatchParallelPattern() 79 for (size_t i = 0; i < input_shape_.size(); ++i) { in MatchParallelPattern() 80 if (input_shape_[i] != output_shape_[i]) { in MatchParallelPattern() 94 …std::accumulate(input_shape_.begin(), input_shape_.begin() + split_axis_, size_t(1), std::multipli… in InitParallelParam() 96 …std::accumulate(input_shape_.begin() + split_axis_ + 1, input_shape_.end(), size_t(1), std::multip… in InitParallelParam() 131 dim_len = SizeToInt(input_shape_[i]); in InitSliceParam() [all …]
|
D | multinomial_cpu_kernel.cc | 25 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in InitKernel() 27 if (input_shape_.size() == 1) { in InitKernel() 28 workspace_size_list_.push_back(input_shape_[0] * sizeof(float)); in InitKernel() 29 } else if (input_shape_.size() == 2) { in InitKernel() 30 workspace_size_list_.push_back(input_shape_[1] * sizeof(float)); in InitKernel() 65 if (input_shape_.size() == 2) { in Launch() 66 num_row = input_shape_[0]; in Launch() 68 int num_col = input_shape_[input_shape_.size() - 1]; in Launch()
|
D | l2_normalize_cpu_kernel.cc | 35 input_shape_ = AnfAlgo::GetInputDeviceShape(kernel_node, 0); in InitKernel() 38 int dims = SizeToInt(input_shape_.size()); in InitKernel() 46 axis_ += SizeToInt(input_shape_.size()); in InitKernel() 55 std::vector<size_t> axes(input_shape_.size()); in CalcDenominator() 63 stride *= input_shape_[i]; in CalcDenominator() 68 std::vector<size_t> transpose_shape(input_shape_.size()); in CalcDenominator() 70 transpose_shape[i] = input_shape_[axes[i]]; in CalcDenominator() 73 TransposeIterator tran_base_iter(std::move(transpose_shape), std::move(axes), input_shape_); in CalcDenominator() 100 BroadcastIterator broad_base_iter(input_shape_, reduce_shape, output_shape_); in CalcOutput() 135 int dims = SizeToInt(input_shape_.size()); in Launch() [all …]
|
D | gather_cpu_kernel.cc | 35 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in InitKernel() 38 if (input_shape_.size() > kGatherInputParamsMaxDim) { in InitKernel() 39 …MS_LOG(EXCEPTION) << "Input dims is " << input_shape_.size() << ", but GatherV2CPUKernel olny supp… in InitKernel() 60 int dims = SizeToInt(input_shape_.size()); in Launch() 79 outer_size *= input_shape_.at(i); in ParallelRun() 81 for (size_t i = axis + 1; i < input_shape_.size(); ++i) { in ParallelRun() 82 inner_size *= input_shape_.at(i); in ParallelRun() 88 auto limit = input_shape_.at(axis); in ParallelRun()
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/nn/ |
D | bce_with_logits_loss_kernel.h | 52 … cudaMemcpyAsync(input_shape, &input_shape_[0], input_shape_.size() * sizeof(size_t), in Launch() 64 …CalBCEWithLogitsLoss(input_size_, predict, target, input_shape, input_shape_.size(), weight, weigh… in Launch() 80 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in Init() 84 …CHECK_NULL_INPUT(input_shape_) || CHECK_NULL_INPUT(weight_shape_) || CHECK_NULL_INPUT(pos_weight_s… in Init() 90 if (input_shape_.size() < 1) { in Init() 92 << input_shape_.size(); in Init() 103 if (input_shape_.size() > MAX_LOGITS_DIMENSION) { in Init() 104 MS_LOG(EXCEPTION) << "Input dimension is " << input_shape_.size() in Init() 107 for (size_t i = 0; i < input_shape_.size(); i++) { in Init() 108 input_size_ *= input_shape_[i]; in Init() [all …]
|
D | instance_norm_gpu_kernel.h | 80 size_t N = input_shape_[0]; in Launch() 81 size_t C = input_shape_[1]; in Launch() 114 input_shape_ = AnfAlgo::GetInputDeviceShape(kernel_node, 0); in Init() 115 if (input_shape_.size() != 4) { in Init() 116 …MS_LOG(EXCEPTION) << "tensor shape is " << input_shape_.size() << ", InstanceNormGpuKernel should … in Init() 118 is_null_input_ = CHECK_NULL_INPUT(input_shape_); in Init() 124 CheckTensorSize({input_shape_}); in Init() 163 input_size_list_.push_back(input_shape_[1]); // gamma in InitSizeLists() 164 input_size_list_.push_back(input_shape_[1]); // beta in InitSizeLists() 165 input_size_list_.push_back(input_shape_[1]); // mean in InitSizeLists() [all …]
|
D | instance_norm_grad_gpu_kernel.h | 81 size_t N = input_shape_[0]; in Launch() 82 size_t C = input_shape_[1]; in Launch() 119 input_shape_ = AnfAlgo::GetInputDeviceShape(kernel_node, 0); in Init() 120 if (input_shape_.size() != 4) { in Init() 121 …MS_LOG(EXCEPTION) << "tensor shape is " << input_shape_.size() << ", InstanceNormGradGpuKernel sho… in Init() 123 is_null_input_ = CHECK_NULL_INPUT(input_shape_); in Init() 129 CheckTensorSize({input_shape_}); in Init() 160 input_size_list_.push_back(input_shape_[1]); in InitSizeLists() 184 int channel = SizeToInt(input_shape_[0]) * SizeToInt(input_shape_[1]); in SetTensorDescriptor() 185 int height = SizeToInt(input_shape_[2]); in SetTensorDescriptor() [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/ps/ |
D | embedding_look_up_ps_kernel.cc | 41 input_shape_ = *(shape_vec[0]); in InitKernel() 42 if (input_shape_.empty()) { in InitKernel() 45 first_dim_size_ = input_shape_[0]; in InitKernel() 46 for (size_t i = 1; i < input_shape_.size(); ++i) { in InitKernel() 47 outer_dim_size_ *= input_shape_[i]; in InitKernel() 58 …offset += Util::LocalShard(SizeToLong(input_shape_[kAxis]), SizeToLong(i), SizeToLong(pserver_num_… in InitKernel() 63 Shard(&input_shape_, kAxis); in InitKernel() 78 for (size_t i = kAxis + 1; i < input_shape_.size(); i++) { in ReInit() 79 output_size *= input_shape_[i]; in ReInit() 107 const std::vector<size_t> &EmbeddingLookUpPSKernel::input_sizes() const { return input_shape_; } in input_sizes()
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/ |
D | softmax_grad_fp32_tests.cc | 39 softmax_param->input_shape_[0] = 1; in InitSoftMaxParam() 40 softmax_param->input_shape_[1] = 9; in InitSoftMaxParam() 41 softmax_param->input_shape_[2] = 11; in InitSoftMaxParam() 42 softmax_param->input_shape_[3] = 12; in InitSoftMaxParam() 49 softmax_param->input_shape_[0] = n; in InitSoftMaxParam() 50 softmax_param->input_shape_[1] = c; in InitSoftMaxParam() 51 softmax_param->input_shape_[2] = h; in InitSoftMaxParam() 52 softmax_param->input_shape_[3] = w; in InitSoftMaxParam() 64 inner_size *= softmax_param->input_shape_[i]; in TEST_F() 68 …float *sum_mul = new (std::nothrow) float[inner_size * softmax_param->input_shape_[softmax_param->… in TEST_F() [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_select/ |
D | tbe_kernel_reduce_selecter.cc | 35 input_shape_.clear(); in GetShapeInfo() 45 input_shape_ = AnfAlgo::GetPrevNodeOutputInferShape(cnode_ptr_, kInputIndex_0); in GetShapeInfo() 46 PadScalarShape(&input_shape_); in GetShapeInfo() 59 if (!Is4DShape(input_shape_)) { in IsReduceSupport5HD() 75 if (!Is5DShape(input_shape_)) { in IsReduceSupportNDC1HWC0() 101 if (input_shape_.size() < kReduceNZMinDim) { in IsReduceSupportFracNZ() 108 return (elem == (this->input_shape_.size() - 1) || elem == (this->input_shape_.size() - 2)); in IsReduceSupportFracNZ() 120 if (!Is4DShape(input_shape_)) { in IsFracZAndC1HWNCoC0Common()
|