Class Truncate
Defined in File text.h
Inheritance Relationships
Base Type
public mindspore::dataset::TensorTransform
(Class TensorTransform)
Class Documentation
-
class Truncate : public mindspore::dataset::TensorTransform
Truncate the input sequence so that it does not exceed the maximum length.
Public Functions
-
explicit Truncate(int32_t max_seq_len)
Constructor.
- 参数
max_seq_len – [in] Maximum allowable length.
样例/* Define operations */ auto truncate_op = text::Truncate(5); /* dataset is an instance of Dataset object */ dataset = dataset->Map({truncate_op}, // operations {"text"}); // input columns
-
~Truncate() override = default
Destructor.
-
explicit Truncate(int32_t max_seq_len)