state_to_device

torch_sim.state.state_to_device(state, device=None, dtype=None)[source]

Convert the SimState to a new device and dtype.

Creates a new SimState with all tensors moved to the specified device and with the specified data type.

Parameters:
  • state (SimState) – The state to convert

  • device (device, optional) – The target device. Defaults to current device.

  • dtype (dtype, optional) – The target data type. Defaults to current dtype.

Returns:

A new SimState with tensors on the specified device and dtype

Return type:

SimState