easy framework

Create a Tensor from a List

Create a tensor from a nested Python list using the framework’s tensor constructor.

Input: A nested list data representing a 2D matrix.

Output: A 2D tensor with the same values.

API Reference:

  • PyTorch: torch.tensor(data)
  • JAX: jnp.array(data)

Hints

tensor-creation torch.tensor jnp.array
Detecting runtime...