MCPcopy
hub / github.com/facebookresearch/mmf / build

Method build

pythia/tasks/base_dataset_builder.py:90–108  ·  view source on GitHub ↗

Similar to load function, used by Pythia to build a dataset for first time when it is not available. This internally calls '_build' function. Override that function in your child class. Args: dataset_type (str): Type of dataset, train|val|test

(self, dataset_type, config, *args, **kwargs)

Source from the content-addressed store, hash-verified

88 )
89
90 def build(self, dataset_type, config, *args, **kwargs):
91 """
92 Similar to load function, used by Pythia to build a dataset for first
93 time when it is not available. This internally calls '_build' function.
94 Override that function in your child class.
95
96 Args:
97 dataset_type (str): Type of dataset, train|val|test
98 config (ConfigNode): Configuration of this dataset loaded from
99 config.
100
101 .. warning::
102
103 DO NOT OVERRIDE in child class. Instead override ``_build``.
104 """
105 # Only build in main process, so none of the others have to build
106 if is_main_process():
107 self._build(dataset_type, config, *args, **kwargs)
108 synchronize()
109
110 def _build(self, dataset_type, config, *args, **kwargs):
111 """

Callers 1

loadMethod · 0.45

Calls 3

_buildMethod · 0.95
is_main_processFunction · 0.90
synchronizeFunction · 0.90

Tested by

no test coverage detected