MCPcopy
hub / github.com/dmlc/dgl / dtype_of

Function dtype_of

python/dgl/utils/internal.py:1171–1175  ·  view source on GitHub ↗

Return the dtype of the data which can be either a tensor or a dict of tensors.

(data)

Source from the content-addressed store, hash-verified

1169
1170
1171def 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")

Calls 2

dtypeMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected