MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / __init__

Method __init__

tensorflow/python/data/ops/dataset_ops.py:1664–1679  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1662 """
1663
1664 def __init__(self):
1665 try:
1666 variant_tensor = self._as_variant_tensor()
1667 except AttributeError as e:
1668 if "_as_variant_tensor" in str(e):
1669 raise AttributeError("Please use _variant_tensor instead of "
1670 "_as_variant_tensor() to obtain the variant "
1671 "associated with a dataset")
1672 raise AttributeError("{}: A likely cause of this error is that the super "
1673 "call for this dataset is not the last line of the "
1674 "__init__ method. The base class causes the "
1675 "_as_variant_tensor call in its constructor and "
1676 "if that uses attributes defined in the __init__ "
1677 "method, those attrs need to be defined before the "
1678 "super call.".format(e))
1679 super(DatasetV1, self).__init__(variant_tensor)
1680
1681 @abc.abstractmethod
1682 def _as_variant_tensor(self):

Callers

nothing calls this directly

Calls 3

_as_variant_tensorMethod · 0.95
formatMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected