Home
last modified time | relevance | path

Searched refs:dsize_t (Results 1 – 25 of 70) sorted by relevance

123

/third_party/mindspore/mindspore/ccsrc/minddata/dataset/core/
Dtensor_shape.h55 static constexpr dsize_t kDimUnknown = -1; // constant for an unknown dimension
63 explicit TensorShape(const std::initializer_list<dsize_t> &list);
68 explicit TensorShape(const std::vector<dsize_t> &list);
92 static TensorShape CreateUnknownShapeWithRank(dsize_t rank);
98 TensorShape InsertDim(dsize_t axis, dsize_t dim) const;
103 TensorShape PrependDim(dsize_t dim) const;
108 TensorShape AppendDim(dsize_t dim) const;
117 dsize_t Size() const { return raw_shape_.size(); } in Size()
119 dsize_t Rank() const { return raw_shape_.size(); } in Rank()
125 dsize_t NumOfElements() const;
[all …]
Dtensor_shape.cc32 constexpr dsize_t TensorShape::kDimUnknown;
34 bool multi_ok(dsize_t x, dsize_t y) { in multi_ok()
35 dsize_t p = x * y; in multi_ok()
42 dsize_t TensorShape::NumOfElements() const { in NumOfElements()
68 TensorShape::TensorShape(const std::initializer_list<dsize_t> &list) in TensorShape()
73 TensorShape::TensorShape(const std::vector<dsize_t> &list) in TensorShape()
87 std::vector<dsize_t> list_c; in TensorShape()
119 TensorShape TensorShape::InsertDim(dsize_t axis, dsize_t dim) const { in InsertDim()
120 std::vector<dsize_t> tmp = AsVector(); in InsertDim()
125 std::vector<dsize_t> TensorShape::AsVector() const { in AsVector()
[all …]
Dtensor.h110 const dsize_t &length, TensorPtr *out);
150 const DataType &type, dsize_t pad_size, TensorPtr *out);
162 static_cast<dsize_t>(items.size()) == shape.NumOfElements(), in CreateFromVector()
177 return CreateFromVector(items, TensorShape({static_cast<dsize_t>(items.size())}), out); in CreateFromVector()
235 Status GetItemAt(T *o, const std::vector<dsize_t> &index) const;
240 Status GetItemAt(std::string_view *o, const std::vector<dsize_t> &index) const;
243 Status GetUnsignedIntAt(T *o, const std::vector<dsize_t> &index) const;
246 Status GetSignedIntAt(T *o, const std::vector<dsize_t> &index) const;
249 Status GetFloatAt(T *o, const std::vector<dsize_t> &index) const;
256 Status SetItemAt(const std::vector<dsize_t> &index, const T &value) { in SetItemAt()
[all …]
Dtensor.cc133 const dsize_t &length, TensorPtr *out) { in CreateFromMemory()
140 dsize_t calculated_length = (*out)->SizeInBytes(); in CreateFromMemory()
145 dsize_t min_length = (shape.NumOfElements() + 1) * kOffsetSize + shape.NumOfElements(); in CreateFromMemory()
167 std::vector<dsize_t> shape; in CreateFromNpString()
168 for (dsize_t i = 0; i < arr.ndim(); i++) { in CreateFromNpString()
169 shape.push_back(static_cast<dsize_t>(arr.shape()[i])); in CreateFromNpString()
193 std::vector<dsize_t> shape; in CreateFromNpArray()
194 std::vector<dsize_t> strides; in CreateFromNpArray()
197 dsize_t count = arr.size(); in CreateFromNpArray()
198 for (dsize_t i = 0; i < arr.ndim(); i++) { in CreateFromNpArray()
[all …]
Dtensor_helpers.cc23 void IndexGeneratorHelper(int8_t depth, std::vector<dsize_t> *numbers, in IndexGeneratorHelper()
25 std::vector<std::vector<dsize_t>> *matrix) { in IndexGeneratorHelper()
41 dsize_t increment = slice_list[curr_ind].slice_.step_; in IndexGeneratorHelper()
44 for (dsize_t i = slice_list[curr_ind].slice_.start_; i < slice_list[curr_ind].slice_.stop_; in IndexGeneratorHelper()
50 for (dsize_t j = slice_list[curr_ind].slice_.start_; j > slice_list[curr_ind].slice_.stop_; in IndexGeneratorHelper()
69 std::vector<std::vector<dsize_t>> IndexGenerator(const std::vector<mindspore::dataset::SliceOption>… in IndexGenerator()
71 std::vector<dsize_t> numbers(depth, 0); in IndexGenerator()
72 std::vector<std::vector<dsize_t>> matrix(0, std::vector<dsize_t>(depth, 0)); in IndexGenerator()
Dtensor_helpers.h39 void IndexGeneratorHelper(int8_t depth, std::vector<dsize_t> *numbers, const std::vector<SliceOptio…
40 std::vector<std::vector<dsize_t>> *matrix);
48 std::vector<std::vector<dsize_t>> IndexGenerator(const std::vector<SliceOption> &slice_list);
Dcv_tensor.h59 static Status CreateFromMat(const cv::Mat &mat, const dsize_t rank, CVTensorPtr *out);
91 Status ExpandDim(const dsize_t &axis) override;
95 Status MatAtIndex(const std::vector<dsize_t> &index, cv::Mat *mat);
Dcv_tensor.cc45 Status CVTensor::CreateFromMat(const cv::Mat &mat, const dsize_t rank, CVTensorPtr *out) { in CreateFromMat()
103 std::vector<dsize_t> sizes = shape.AsVector(); in MatInit()
123 Status CVTensor::ExpandDim(const dsize_t &axis) { in ExpandDim()
137 Status CVTensor::MatAtIndex(const std::vector<dsize_t> &index, cv::Mat *mat) { in MatAtIndex()
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/engine/perf/
Dcyclic_array.h50 Iterator(dsize_t idx, pointer ptr, dsize_t capacity, dsize_t head) in Iterator()
79 …Iterator operator+(dsize_t x) { return Iterator((cur_idx_ + x) % (capacity_ + 1), ptr_, capacity_,…
81 Iterator operator-(dsize_t x) {
114 dsize_t cur_idx_;
116 dsize_t capacity_;
117 dsize_t head_;
125 explicit CyclicArray(dsize_t capacity) in CyclicArray()
160 dsize_t size() { return size_; } in size()
163 dsize_t capacity() { return capacity_; } in capacity()
181 const T &operator[](dsize_t idx) const { return buf_[(head_ + idx) % (capacity_ + 1)]; }
[all …]
Dperf_data.h41 PerfData(dsize_t max_rows, dsize_t n_cols) : counter_(0), max_rows_(max_rows), n_cols_(n_cols) { in PerfData()
64 auto Row(dsize_t idx) { in Row()
79 dsize_t size() { return counter_ < max_rows_ ? counter_ : max_rows_; } in size()
81 dsize_t capacity() { return max_rows_; } in capacity()
85 dsize_t counter_;
86 dsize_t max_rows_;
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/include/dataset/
Dtransforms.h88 Slice(dsize_t start, dsize_t stop, dsize_t step) : start_(start), stop_(stop), step_(step) {} in Slice()
92 Slice(dsize_t start, dsize_t stop) : start_(start), stop_(stop), step_(1) {} in Slice()
95 explicit Slice(dsize_t stop) : start_(0), stop_(stop), step_(1) {} in Slice()
101 dsize_t start_;
102 dsize_t stop_;
103 dsize_t step_;
112 explicit SliceOption(std::vector<dsize_t> indices) : indices_(indices) {} in SliceOption()
121 std::vector<dsize_t> indices_ = {};
271 explicit PadEnd(const std::vector<dsize_t> &pad_shape, const MSTensor &pad_value = {});
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/kernels/data/
Ddata_utils.h42 …coding(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output, dsize_t num_classes);
45 dsize_t num_classes, int64_t index);
47 …gSigned(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output, dsize_t num_classes,
81 … std::shared_ptr<Tensor> &src, std::shared_ptr<Tensor> *dst, const std::vector<dsize_t> &pad_shape,
91 const std::vector<dsize_t> &pad_shape, float pad_val);
103 std::vector<dsize_t> cur_ind, size_t cur_dim = 0);
112 const std::vector<dsize_t> &pad_shape, const std::string &pad_val);
124 … const TensorShape &dst_shape, std::vector<dsize_t> cur_ind, size_t cur_dim,
Ddata_utils.cc38 dsize_t num_classes, int64_t index) { in OneHotEncodingUnsigned()
50 RETURN_IF_NOT_OK((*output)->SetItemAt<uint64_t>({index, static_cast<dsize_t>(class_idx)}, 1)); in OneHotEncodingUnsigned()
52 RETURN_IF_NOT_OK((*output)->SetItemAt<uint32_t>({index, static_cast<dsize_t>(class_idx)}, 1)); in OneHotEncodingUnsigned()
54 RETURN_IF_NOT_OK((*output)->SetItemAt<uint16_t>({index, static_cast<dsize_t>(class_idx)}, 1)); in OneHotEncodingUnsigned()
56 RETURN_IF_NOT_OK((*output)->SetItemAt<uint8_t>({index, static_cast<dsize_t>(class_idx)}, 1)); in OneHotEncodingUnsigned()
63 …gSigned(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output, dsize_t num_classes, in OneHotEncodingSigned()
76 RETURN_IF_NOT_OK((*output)->SetItemAt<int64_t>({index, static_cast<dsize_t>(class_idx)}, 1)); in OneHotEncodingSigned()
78 RETURN_IF_NOT_OK((*output)->SetItemAt<int32_t>({index, static_cast<dsize_t>(class_idx)}, 1)); in OneHotEncodingSigned()
80 RETURN_IF_NOT_OK((*output)->SetItemAt<int16_t>({index, static_cast<dsize_t>(class_idx)}, 1)); in OneHotEncodingSigned()
82 RETURN_IF_NOT_OK((*output)->SetItemAt<int8_t>({index, static_cast<dsize_t>(class_idx)}, 1)); in OneHotEncodingSigned()
[all …]
Done_hot_op.cc35 if (inputs_copy[0].Rank() == 0) outputs.emplace_back(std::vector<dsize_t>{num_classes_}); in OutputShape()
36 …if (inputs_copy[0].Rank() == 1) outputs.emplace_back(std::vector<dsize_t>{inputs_copy[0][0], num_c… in OutputShape()
Dconcatenate_op.cc41 dsize_t output_shape = 0; in OutputShape()
60 outputs.emplace_back(std::vector<dsize_t>{output_shape}); in OutputShape()
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/
Dbounding_box.cc30 Status BoundingBox::ReadFromTensor(const TensorPtr &bbox_tensor, dsize_t index_of_bbox, in ReadFromTensor()
88 Status BoundingBox::WriteToTensor(const TensorPtr &bbox_tensor, dsize_t index_of_bbox) { in WriteToTensor()
100 dsize_t num_of_boxes = bbox_tensor->shape()[0]; in GetListOfBoundingBoxes()
101 for (dsize_t i = 0; i < num_of_boxes; i++) { in GetListOfBoundingBoxes()
111 dsize_t num_of_boxes = bboxes.size(); in CreateTensorFromBoundingBoxList()
113 for (dsize_t i = 0; i < num_of_boxes; i++) { in CreateTensorFromBoundingBoxList()
123 for (dsize_t i = 0; i < bbox_count; i++) { in PadBBoxes()
142 std::vector<dsize_t> correct_ind; in UpdateBBoxesForCrop()
144 dsize_t bboxDim = (*bbox_list)->shape()[1]; in UpdateBBoxesForCrop()
145 for (dsize_t i = 0; i < *bbox_count; i++) { in UpdateBBoxesForCrop()
[all …]
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/text/kernels/
Dtruncate_sequence_pair_op.cc33 dsize_t length1 = seq1->shape()[0]; in Compute()
34 dsize_t length2 = seq2->shape()[0]; in Compute()
35 dsize_t outLength1 = length1; in Compute()
36 dsize_t outLength2 = length2; in Compute()
38 dsize_t total = length1 + length2; in Compute()
Dtruncate_sequence_pair_op.h33 explicit TruncateSequencePairOp(dsize_t max_length) : max_length_(max_length) {} in TruncateSequencePairOp()
48 dsize_t max_length_;
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/
Dcoco_op.cc93 dsize_t bbox_row_num = static_cast<dsize_t>(bboxRow.size()); in LoadTensorRow()
94 dsize_t bbox_column_num = 0; in LoadTensorRow()
96 if (static_cast<dsize_t>(bbox.size()) > bbox_column_num) { in LoadTensorRow()
97 bbox_column_num = static_cast<dsize_t>(bbox.size()); in LoadTensorRow()
103 dsize_t pad_len = bbox_column_num - static_cast<dsize_t>(bbox.size()); in LoadTensorRow()
105 for (dsize_t i = 0; i < pad_len; i++) { in LoadTensorRow()
111 std::vector<dsize_t> bbox_dim = {bbox_row_num, bbox_column_num}; in LoadTensorRow()
147 category_id_row, TensorShape({static_cast<dsize_t>(category_id_row.size()), 1}), &category_id)); in LoadDetectionTensorRow()
150 …Tensor::CreateFromVector(iscrowd_row, TensorShape({static_cast<dsize_t>(iscrowd_row.size()), 1}), … in LoadDetectionTensorRow()
182 std::vector<dsize_t> bbox_dim = {static_cast<dsize_t>(item_queue.size()), 1}; in LoadSimpleTensorRow()
[all …]
Drandom_data_op.cc89 std::vector<dsize_t> dims; in GenerateSchema()
93 dsize_t dim_value = static_cast<dsize_t>(GenRandomInt(0, kMaxDimValue)); in GenerateSchema()
277 std::vector<dsize_t> current_shape = current_col.Shape().AsVector(); in CreateRandomRow()
286 current_shape[j] = static_cast<dsize_t>(GenRandomInt(1, kMaxDimValue)); in CreateRandomRow()
/third_party/mindspore/tests/ut/cpp/dataset/
Dtensorshape_test.cc39 std::vector<dsize_t> vec = {4, 5, 6}; in TEST_F()
46 for (dsize_t i = 0; i < t.Rank(); i++) { in TEST_F()
71 ASSERT_EQ(t.AsVector(), std::vector<dsize_t>{}); in TEST_F()
73 TensorShape t2(std::vector<dsize_t>{}); in TEST_F()
98 ASSERT_EQ(t1.AsVector(), std::vector<dsize_t>({-1, 5, 6})); in TEST_F()
Dc_api_dataset_coco_test.cc20 using mindspore::dataset::dsize_t;
173 dsize_t bbox_num = static_cast<dsize_t>(expect_bbox_vector[i].size() / 4); in TEST_F()
252 std::vector<std::vector<dsize_t>> expect_size = {{1, 51}, {1, 51}}; in TEST_F()
264 dsize_t keypoints_size = expect_size[i][0]; in TEST_F()
312 std::vector<std::vector<dsize_t>> expect_size = {{3, 4}, {2, 4}}; in TEST_F()
325 dsize_t bbox_size = expect_size[i][0]; in TEST_F()
412 …std::vector<std::vector<dsize_t>> expect_size = {{2, 10}, {2, 11}, {1, 12}, {1, 13}, {1, 14}, {2, … in TEST_F()
Dslice_op_test.cc253 std::vector<dsize_t> index1 = {1, 2}; in TEST_F()
254 std::vector<dsize_t> index2 = {0, 1}; in TEST_F()
283 std::vector<dsize_t> indices = {0}; in TEST_F()
311 std::vector<dsize_t> indices = {0}; in TEST_F()
386 std::vector<dsize_t> indices = {0}; in TEST_F()
404 std::vector<dsize_t> indices = {8}; in TEST_F()
506 std::vector<dsize_t> index1 = {1, 2}; in TEST_F()
507 std::vector<dsize_t> index2 = {0, 1}; in TEST_F()
535 std::vector<dsize_t> indices = {0}; in TEST_F()
562 std::vector<dsize_t> indices = {0}; in TEST_F()
[all …]
Dsliding_window_op_test.cc33 TensorShape shape({static_cast<dsize_t>(strings.size())}); in TEST_F()
58 TensorShape shape({static_cast<dsize_t>(strings.size())}); in TEST_F()
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/engine/gnn/
Dtensor_proto.cc49 std::vector<dsize_t> shape = tensor->shape().AsVector(); in TensorToPb()
66 std::vector<dsize_t> shape; in PbToTensor()
69 [](const google::protobuf::int64 dim) { return static_cast<dsize_t>(dim); }); in PbToTensor()

123