Class TruncateSequencePair

Inheritance Relationships

Base Type

Class Documentation

class TruncateSequencePair : public mindspore::dataset::TensorTransform

Truncate a pair of rank-1 tensors such that the total length is less than max_length.

Public Functions

explicit TruncateSequencePair(int32_t max_length)

Constructor.

Parameters

max_length[in] Maximum length required.

Example
/* Define operations */
auto truncate_op = text::TruncateSequencePair(5);

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

Destructor.