| | |
| | | from typing import List |
| | | from typing import Dict |
| | | from typing import Sequence |
| | | from typing import Tuple |
| | | from typing import Union |
| | | |
| | | from typeguard import check_argument_types |
| | | from typeguard import check_return_type |
| | | |
| | | from funasr.samplers.abs_sampler import AbsSampler |
| | | from funasr.samplers.folded_batch_sampler import FoldedBatchSampler |
| | |
| | | type: str, |
| | | batch_size: int, |
| | | batch_bins: int, |
| | | shape_files: Union[Tuple[str, ...], List[str]], |
| | | shape_files: Union[Tuple[str, ...], List[str], Dict], |
| | | sort_in_batch: str = "descending", |
| | | sort_batch: str = "ascending", |
| | | drop_last: bool = False, |
| | |
| | | padding: Whether sequences are input as a padded tensor or not. |
| | | used for "numel" mode |
| | | """ |
| | | assert check_argument_types() |
| | | if len(shape_files) == 0: |
| | | raise ValueError("No shape file are given") |
| | | |
| | |
| | | |
| | | else: |
| | | raise ValueError(f"Not supported: {type}") |
| | | assert check_return_type(retval) |
| | | return retval |