Return tensor shape of this variable It is modifiable when current variable is not a paramter.
(self)
| 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): |
no test coverage detected