tensors

Utilities for manipulating numpy and pytorch tensors using a consistent API.

Classes

TYPE_CHECKING

bool(x) -> bool

Functions

append_zero

cdist

concatenate

Concatenate multiple arrays along a specified dimension.

inverse_cdist

pairwise_differences

Returns a tensor containing the vectors which point from all of the points (with dimension of n_dim) in tensor a to all of the points in tensor b.

to_numpy

Converts an array-like object (either numpy or pytorch) into a numpy array.

to_torch

Converts an array-like object (either numpy or pytorch) into a pytorch tensor.