graphlow.TensorMesh.to#
- TensorMesh.to(device: torch.device | str | None = None, non_blocking: bool = False, dtype: torch.dtype | None = None) TensorMesh[T]#
Move the mesh data to a different device and/or dtype.
- Parameters:
- device: torch.device | str | None
The device to move the mesh to. The default is None.
- non_blocking: bool
If True, the transfer happens asynchronously. The default is False.
- dtype: torch.dtype | None
The floating-point dtype to move the mesh to. The default is None.
- Returns:
- TensorMesh[T]
The moved mesh.