mindspore/docs/api/api_python/dataset_text/mindspore.dataset.text.Trun...

15 lines
484 B
ReStructuredText
Raw Normal View History

2022-06-22 10:46:33 +08:00
mindspore.dataset.text.TruncateSequencePair
===========================================
2022-02-14 14:34:37 +08:00
2022-06-22 10:46:33 +08:00
.. py:class:: mindspore.dataset.text.TruncateSequencePair(max_length)
2022-02-14 14:34:37 +08:00
截断一对 1-D 字符串的内容,使其总长度小于给定长度。
TruncateSequencePair接收两个Tensor作为输入并返回两个Tensor作为输出。
2022-07-08 16:45:20 +08:00
参数:
- **max_length** (int) - 最大截断长度。
2022-02-14 14:34:37 +08:00
2022-07-08 16:45:20 +08:00
异常:
- **TypeError** - 参数 `max_length` 的类型不是int。