MCPcopy Create free account
hub / github.com/tensorflow/datasets / _SplitAdd

Class _SplitAdd

tensorflow_datasets/core/splits.py:669–686  ·  view source on GitHub ↗

Sum of 2 splits. `'train+test'` is equivalent to `_SplitAdd(ReadInstruction('train'), ReadInstruction('test'))`

Source from the content-addressed store, hash-verified

667
668@dataclasses.dataclass(frozen=True)
669class _SplitAdd(AbstractSplit):
670 """Sum of 2 splits.
671
672 `'train+test'` is equivalent to
673 `_SplitAdd(ReadInstruction('train'), ReadInstruction('test'))`
674 """
675
676 left: AbstractSplit
677 right: AbstractSplit
678
679 def __repr__(self):
680 return f'{self.left!r}+{self.right!r}'
681
682 def to_absolute(self, split_infos) -> list[_AbsoluteInstruction]:
683 # Merge instructions from left and right
684 return self.left.to_absolute(split_infos) + self.right.to_absolute(
685 split_infos
686 )
687
688
689class _SplitAll(AbstractSplit):

Callers 1

__add__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected