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

Method to_absolute

tensorflow_datasets/core/subsplits_utils.py:37–50  ·  view source on GitHub ↗
(self, split_infos: splits_lib.SplitDict)

Source from the content-addressed store, hash-verified

35 drop_remainder: bool
36
37 def to_absolute(self, split_infos: splits_lib.SplitDict):
38 # Extract the absolute instructions
39 # One absolute instruction is created per `+`, so `train[:54%]+train[60%:]`
40 # will create 2 absolute instructions.
41 read_instruction = splits_lib.AbstractSplit.from_spec(self.split)
42 absolute_instructions = read_instruction.to_absolute(split_infos)
43
44 # Create the subsplit
45 read_instructions_for_index = [
46 self._absolute_to_read_instruction_for_index(abs_inst, split_infos)
47 for abs_inst in absolute_instructions
48 ]
49 instuctions = functools.reduce(operator.add, read_instructions_for_index)
50 return instuctions.to_absolute(split_infos)
51
52 def _absolute_to_read_instruction_for_index(
53 self,

Callers

nothing calls this directly

Calls 3

reduceMethod · 0.80
from_specMethod · 0.45

Tested by

no test coverage detected