Class TruncateSequencePair
Defined in File text.h
Inheritance Relationships
Base Type
public mindspore::dataset::TensorTransform
(Class TensorTransform)
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.
样例/* 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.
-
explicit TruncateSequencePair(int32_t max_length)