Return the dtype of the data which can be either a tensor or a dict of tensors.
(data)
| 1169 | |
| 1170 | |
| 1171 | def dtype_of(data): |
| 1172 | """Return the dtype of the data which can be either a tensor or a dict of tensors.""" |
| 1173 | return F.dtype( |
| 1174 | next(iter(data.values())) if isinstance(data, Mapping) else data |
| 1175 | ) |
| 1176 | |
| 1177 | |
| 1178 | _init_api("dgl.utils.internal") |
no test coverage detected