We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
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
Sign in to attempt this problem and view the solution.