"...asr/git@developer.sourcefind.cn:hehl2/torchaudio.git" did not exist on "697f92f1cdec1d717b9ee6fd71634eb89ac13cbe"
Unverified Commit 956ae621 authored by substanc3's avatar substanc3 Committed by GitHub
Browse files

Fix wrong documentation about DataCollator padding defaults (#21919)

* Fix wrong documentation about DataCollator padding defaults

* Fix styling
parent 8c40ba73
...@@ -274,12 +274,11 @@ class DataCollatorForTokenClassification(DataCollatorMixin): ...@@ -274,12 +274,11 @@ class DataCollatorForTokenClassification(DataCollatorMixin):
Select a strategy to pad the returned sequences (according to the model's padding side and padding index) Select a strategy to pad the returned sequences (according to the model's padding side and padding index)
among: among:
- `True` or `'longest'`: Pad to the longest sequence in the batch (or no padding if only a single sequence - `True` or `'longest'` (default): Pad to the longest sequence in the batch (or no padding if only a single
is provided). sequence is provided).
- `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum - `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum
acceptable input length for the model if that argument is not provided. acceptable input length for the model if that argument is not provided.
- `False` or `'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of different - `False` or `'do_not_pad'`: No padding (i.e., can output a batch with sequences of different lengths).
lengths).
max_length (`int`, *optional*): max_length (`int`, *optional*):
Maximum length of the returned list and optionally padding length (see above). Maximum length of the returned list and optionally padding length (see above).
pad_to_multiple_of (`int`, *optional*): pad_to_multiple_of (`int`, *optional*):
...@@ -531,12 +530,11 @@ class DataCollatorForSeq2Seq: ...@@ -531,12 +530,11 @@ class DataCollatorForSeq2Seq:
Select a strategy to pad the returned sequences (according to the model's padding side and padding index) Select a strategy to pad the returned sequences (according to the model's padding side and padding index)
among: among:
- `True` or `'longest'`: Pad to the longest sequence in the batch (or no padding if only a single sequence - `True` or `'longest'` (default): Pad to the longest sequence in the batch (or no padding if only a single
is provided). sequence is provided).
- `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum - `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum
acceptable input length for the model if that argument is not provided. acceptable input length for the model if that argument is not provided.
- `False` or `'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of different - `False` or `'do_not_pad'`: No padding (i.e., can output a batch with sequences of different lengths).
lengths).
max_length (`int`, *optional*): max_length (`int`, *optional*):
Maximum length of the returned list and optionally padding length (see above). Maximum length of the returned list and optionally padding length (see above).
pad_to_multiple_of (`int`, *optional*): pad_to_multiple_of (`int`, *optional*):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment