torchcontrol.utils package

Submodules

torchcontrol.utils.tensor_utils module

torchcontrol.utils.tensor_utils.diagonalize_gain(input: Tensor)

Converts a 1-D vector into a diagonal 2-D matrix.

  • If the input tensor is 1-dimensional, interprets it as the diagonal and constructs the corresponding diagonal matrix.

  • If the input tensor is 2-dimensional, simply returns it.

  • Otherwise raises an AssertionError

torchcontrol.utils.tensor_utils.stack_trajectory(input)
torchcontrol.utils.tensor_utils.to_tensor(input)

Converts the input into a torch.Tensor of the default dtype.

Module contents