adam.pytorch.torch_like#

Classes#

TorchLike

Class wrapping pyTorch types

TorchLikeFactory

Generic factory. Give it (a) a Like class and (b) an xp namespace

SpatialMath

A drop-in SpatialMath that implements sin/cos/outer/concat/skew with the Array API.

Module Contents#

class adam.pytorch.torch_like.TorchLike[source]#

Bases: adam.core.array_api_math.ArrayAPILike

Class wrapping pyTorch types

array: torch.Tensor[source]#
class adam.pytorch.torch_like.TorchLikeFactory(spec: adam.core.array_api_math.ArraySpec | None = None)[source]#

Bases: adam.core.array_api_math.ArrayAPIFactory

Generic factory. Give it (a) a Like class and (b) an xp namespace (array_api_compat.* if available; otherwise the library module).

xp[source]#
class adam.pytorch.torch_like.SpatialMath(spec: adam.core.array_api_math.ArraySpec | None = None)[source]#

Bases: adam.core.array_api_math.ArrayAPISpatialMath

A drop-in SpatialMath that implements sin/cos/outer/concat/skew with the Array API.

Works for NumPy, PyTorch, and JAX; CasADi should keep its own subclass.

solve(A: adam.core.array_api_math.ArrayAPILike, B: adam.core.array_api_math.ArrayAPILike) adam.core.array_api_math.ArrayAPILike[source]#

Override solve to use torch.linalg.solve directly to avoid array_api_compat bug