![]() |
Reading instruction for a dataset.
tfds.core.ReadInstruction(
split_name: str,
from_: Optional[int] = None,
to: Optional[int] = None,
unit: str = 'abs',
rounding: str = 'closest'
)
See the guide: https://www.tensorflow.org/datasets/splits
Methods
from_spec
@classmethod
from_spec( spec: SplitArg ) -> 'AbstractSplit'
Creates a ReadInstruction instance out of a string spec.
Args | |
---|---|
spec (str): split(s) + optional slice(s) to read. A slice can be
specified, using absolute numbers (int) or percentages (int). E.g.
test : test split. test + validation : test split + validation split.
test[10:] : test split, minus its first 10 records. test[:10%] : first
10% records of test split. test[:-5%]+train[40%:60%] : first 95% of
test + middle 20% of train.
|
Returns | |
---|---|
The split instance. |
to_absolute
to_absolute(
split_infos
) -> List[_AbsoluteInstruction]
Translate instruction into a list of absolute instructions.
Those absolute instructions are then to be added together.
Args | |
---|---|
split_infos
|
tfds.core.SplitDict dict associating split names to split
info.
|
Returns | |
---|---|
list of _AbsoluteInstruction instances (corresponds to the + in spec). |
__add__
__add__(
other: Union[str, 'AbstractSplit']
) -> 'AbstractSplit'
Sum of 2 splits.
__eq__
__eq__(
other
)
Class Variables | |
---|---|
from<a id="from"> |
None
|
rounding |
'closest'
|
to |
None
|
unit |
'abs'
|