kornia.testing#

The testing package contains testing-specific utilities.

kornia.testing.create_eye_batch(batch_size, eye_size, device=None, dtype=None)[source]#

Create a batch of identity matrices of shape Bx3x3.

Return type:

Tensor

kornia.testing.tensor_to_gradcheck_var(tensor, dtype=torch.float64, requires_grad=True)[source]#

Convert the input tensor to a valid variable to check the gradient.

gradcheck needs 64-bit floating point and requires gradient.

Return type:

Union[Tensor, str]

kornia.testing.xla_is_available()[source]#

Return whether torch_xla is available in the system.

Return type:

bool