Class PadEnd

Inheritance Relationships

Base Type

Class Documentation

class PadEnd : public mindspore::dataset::TensorTransform

Pad input tensor according to pad_shape.

Public Functions

explicit PadEnd(const std::vector<dsize_t> &pad_shape, const MSTensor &pad_value = {})

Constructor.

Parameters
  • pad_shape[in] List of integers representing the shape needed, need to have same rank with input tensor. Dimensions that set to -1 will not be padded (i.e., original dim will be used). Shorter dimensions will truncate the values.

  • pad_value[in] Value used to pad (default={}).

Example
/* Define operations */
mindspore::MSTensor constant;
auto pad_end_op = transforms::PadEnd({224, 224, 1}, {constant});

/* dataset is an instance of Dataset object */
dataset = dataset->Map({pad_end_op},    // operations
                       {"column"});     // input columns
~PadEnd() = default

Destructor.