We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
← Tensor Foundations step 1 of 7
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)
Nothing accepted yet. When a submission passes, the code that passed shows up
here, one entry per mode.
Stuck?
PyTorch reference solution
Sign in to attempt this problem and reveal the reference solution.