Home
last modified time | relevance | path

Searched refs:pad_shape (Results 1 – 17 of 17) sorted by relevance

/third_party/mindspore/mindspore/ccsrc/minddata/dataset/engine/datasetops/
Dbucket_batch_by_length_op.cc136 std::vector<dsize_t> pad_shape = pair.second.first.AsVector(); in PadAndBatchBucket() local
138 for (size_t i = 0; i < pad_shape.size(); i++) { in PadAndBatchBucket()
139 if (pad_shape[i] == TensorShape::kDimUnknown) { in PadAndBatchBucket()
146 pad_shape[i] = bucket_boundaries_[bucket_index + 1] - 1; in PadAndBatchBucket()
150 pair.second.first = TensorShape(pad_shape); in PadAndBatchBucket()
/third_party/mindspore/tests/ut/python/dataset/
Dtest_pad_end_op.py27 def pad_compare(array, pad_shape, pad_value, res): argument
30 data = data.map(operations=ops.PadEnd(pad_shape, pad_value))
32 data = data.map(operations=ops.PadEnd(pad_shape))
/third_party/mindspore/mindspore/lite/src/runtime/kernel/opencl/kernel/
Dpad.cc67 auto pad_shape = in_tensors_.at(1)->shape(); in CheckSpecs() local
68 if (pad_shape.size() != DIMENSION_2D || pad_shape[0] != in_ndim || pad_shape[1] != DIMENSION_2D) { in CheckSpecs()
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/kernels/data/
Dpad_end_op.h30 explicit PadEndOp(const TensorShape &pad_shape, const std::shared_ptr<Tensor> &pad_value) in PadEndOp() argument
31 : output_shape_(pad_shape), pad_val_(pad_value) {} in PadEndOp()
Ddata_utils.cc376 … std::shared_ptr<Tensor> &src, std::shared_ptr<Tensor> *dst, const std::vector<dsize_t> &pad_shape, in PadEnd() argument
380 return PadEndNumeric(src, dst, pad_shape, 0); in PadEnd()
382 return PadEndString(src, dst, pad_shape, ""); in PadEnd()
394 return PadEndNumeric(src, dst, pad_shape, val); in PadEnd()
398 return PadEndString(src, dst, pad_shape, std::string(val)); in PadEnd()
402 const std::vector<dsize_t> &pad_shape, float pad_val) { in PadEndNumeric() argument
404 if (src->Rank() == 0 || src->shape().AsVector() == pad_shape) { in PadEndNumeric()
407 CHECK_FAIL_RETURN_UNEXPECTED(src->Rank() == pad_shape.size(), in PadEndNumeric()
409 ", and rank of pad value: " + std::to_string(pad_shape.size())); in PadEndNumeric()
410 RETURN_IF_NOT_OK(Tensor::CreateEmpty(TensorShape(pad_shape), src->type(), dst)); in PadEndNumeric()
[all …]
Ddata_utils.h81 … 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);
112 const std::vector<dsize_t> &pad_shape, const std::string &pad_val);
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/hccl/
Dhccl_kernel_metadata.cc51 auto pad_shape = trans::PaddingShapeTo4dDefault(input_shape); in GetKernelFormat() local
52 if (pad_shape[N_nchw] % kCubeSize != 0 || pad_shape[C_nchw] % kCubeSize != 0) { in GetKernelFormat()
/third_party/mindspore/mindspore/dataset/transforms/
Dc_transforms.py310 def __init__(self, pad_shape, pad_value=None): argument
311 self.pad_shape = cde.TensorShape(pad_shape)
315 return cde.PadEndOperation(self.pad_shape, self.pad_value)
Dvalidators.py165 [pad_shape, pad_value], _ = parse_user_args(method, *args, **kwargs)
169 type_check(pad_shape, (list,), "pad_shape")
171 for dim in pad_shape:
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/api/
Dtransforms.cc163 explicit Data(const std::vector<dsize_t> &pad_shape, const MSTensor &pad_value) in Data()
164 : pad_shape_(pad_shape), pad_value_(pad_value) {} in Data()
169 PadEnd::PadEnd(const std::vector<dsize_t> &pad_shape, const MSTensor &pad_value) in PadEnd() argument
170 : data_(std::make_shared<Data>(pad_shape, pad_value)) {} in PadEnd()
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/graph_kernel/
Dinsert_pad.cc150 const vec &pad_shape, const vec &tail_shape) { in InsertPad() argument
166 (void)abs_shape.insert(abs_shape.begin(), pad_shape.begin(), pad_shape.end()); in InsertPad()
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/kernels/ir/
Dbindings.cc139 .def(py::init([](TensorShape pad_shape, const std::shared_ptr<Tensor> &pad_value) { in __anon360f34601002() argument
140 auto pad_end = std::make_shared<transforms::PadEndOperation>(pad_shape, pad_value); in __anon360f34601002()
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/kernels/ir/data/
Dtransforms_ir.cc192 PadEndOperation::PadEndOperation(const TensorShape &pad_shape, const std::shared_ptr<Tensor> &pad_v… in PadEndOperation() argument
193 : pad_shape_(pad_shape), pad_value_(pad_value) {} in PadEndOperation()
Dtransforms_ir.h159 explicit PadEndOperation(const TensorShape &pad_shape, const std::shared_ptr<Tensor> &pad_value);
/third_party/mindspore/mindspore/numpy/
Darray_creations.py2369 pad_shape = pad_tensor.shape
2370 if not pad_shape:
2372 elif pad_shape == (1,):
2374 elif pad_shape == (2,):
2376 elif pad_shape == (1, 2):
2378 elif pad_shape == (ndim, 2):
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/
Dascend_helper.cc293 …ShapeVector pad_shape = trans::PaddingShape(out_shape, AnfAlgo::GetOutputFormat(input, 0), padding… in NewTransOpNode() local
297 pad_shape_ptr = std::make_shared<abstract::Shape>(pad_shape, pad_shape_min, pad_shape_max); in NewTransOpNode()
299 pad_shape_ptr = std::make_shared<abstract::Shape>(pad_shape); in NewTransOpNode()
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/include/dataset/
Dtransforms.h271 explicit PadEnd(const std::vector<dsize_t> &pad_shape, const MSTensor &pad_value = {});