cerebras.modelzoo.data.common.tensor_spec.TensorSpec#
- class cerebras.modelzoo.data.common.tensor_spec.TensorSpec[source]#
Bases:
object
Wrapper class used to wrap the leaf nodes in SyntheticDataProcessor’s input.
TensorSpecs hold a dictionary of arguments used to specify a tensor. An instance of this class is constructed to wrap a dictionary if the dictionary in the input contains at least one of ‘shape’, ‘dtype’, or ‘tensor_factory’ keys.
- Example list element format in yaml file:
shape: … dtype: …
This class merely holds the provided dictionary of kwargs. See models/common/pytorch/input/SyntheticDataProcessor.py for more docs and use cases.
- Parameters
kwargs – Any variable number of keyword arguments written as a dictionary
above. (under the tag in the .yaml file as seen in the example) –
Methods