7. Seeded Random Tensor

Easy

Create a 3×3×3 tensor of random values uniformly distributed in [0, 1). For reproducibility, seed the random number generator with 0 immediately before generating it, inside solve: the seed is global, shared state, so seeding it anywhere else (e.g. once at import time) won't reliably reproduce the same numbers.

Output

tensor([[[0.4963, 0.7682, 0.0885],
         [0.1320, 0.3074, 0.6341],
         [0.4901, 0.8964, 0.4556]],

        [[0.6323, 0.3489, 0.4017],
         [0.0223, 0.1689, 0.2939],
         [0.5185, 0.6977, 0.8000]],

        [[0.1610, 0.2823, 0.6816],
         [0.9152, 0.3971, 0.8742],
         [0.4194, 0.5529, 0.9527]]])

Sign in to write and run your own code.

Implement solve(...)