MCPcopy
hub / github.com/OpenPPL/ppq / dtype

Method dtype

ppq/IR/base/graph.py:119–128  ·  view source on GitHub ↗

Return tensor shape of this variable It is modifiable when current variable is not a paramter.

(self)

Source from the content-addressed store, hash-verified

117
118 @ property
119 def dtype(self) -> DataType:
120 """ Return tensor shape of this variable
121 It is modifiable when current variable is not a paramter.
122 """
123 if self.value is not None:
124 if isinstance(self.value, torch.Tensor):
125 return DataType.convert_from_torch(self.value.dtype)
126 if isinstance(self.value, np.ndarray):
127 return DataType.convert_from_numpy(self.value.dtype)
128 return self._dtype
129
130 @ dtype.setter
131 def dtype(self, T: DataType):

Callers 2

Example_PTQ.pyFile · 0.80

Calls 2

convert_from_torchMethod · 0.80
convert_from_numpyMethod · 0.80

Tested by

no test coverage detected