Lines Matching full:rand
352 x = torch.rand(5, 2, 3)
353 y = torch.rand(3, 5, 2)
649 x_orig = torch.rand(B0, 5)
656 x_orig = torch.rand(B0, 5)
719 x = torch.rand(B0, 7)
720 y = torch.rand(7)
724 x_orig = torch.rand(B0, 7)
726 y = torch.rand(7)
730 x_orig = torch.rand(B0, B1, 7)
732 y = torch.rand(B0, 7)
738 x = torch.rand(7)
739 y = torch.rand(B0, 7)
743 x = torch.rand(B1, 7)
744 y = torch.rand(B0, 7)
748 x = torch.rand(B1, 7)
749 y = torch.rand(7, B0)
753 x = torch.rand(B0, 7)
754 y = torch.rand(B0, B1, 7)
887 def rand(size, device="cpu", dtype=torch.float): member in TensorFactory
888 return torch.rand(size, device=device, dtype=dtype)
896 return torch.rand(size, device=device, dtype=dtype) + 1
1006 vmap(op_using_fallback)(torch.rand(3))
1020 vmap(op_using_fallback)(torch.rand(3))
1057 (torch.acos, TensorFactory.rand),
1058 (torch.asin, TensorFactory.rand),
1059 (torch.atan, TensorFactory.rand),
1061 (torch.cos, TensorFactory.rand),
1062 (torch.cosh, TensorFactory.rand),
1063 (torch.digamma, TensorFactory.rand),
1068 (torch.lgamma, TensorFactory.rand),
1080 (torch.sin, TensorFactory.rand),
1081 (torch.sinh, TensorFactory.rand),
1082 (torch.sqrt, TensorFactory.rand),
1083 (torch.tan, TensorFactory.rand),
1084 (torch.tanh, TensorFactory.rand),
1316 test(op, (torch.rand(B0, 2, 3, 5), torch.rand(2, 5, 3)), in_dims=(0, None))
1319 (torch.rand(B1, B0, 2, 3, 5), torch.rand(2, 5, 3)),
1324 test(op, (torch.rand(2, 5, 3), torch.rand(B0, 2, 3, 5)), in_dims=(None, 0))
1327 (torch.rand(2, 5, 3), torch.rand(B1, B0, 2, 3, 5)),
1332 test(op, (torch.rand(B0, 2, 3, 5), torch.rand(B0, 2, 5, 3)))
1335 (torch.rand(B1, B0, 2, 3, 5), torch.rand(B0, B1, 2, 5, 3)),
1340 (torch.rand(B1, 2, 3, 5), torch.rand(B0, 2, 5, 3)),
1355 test(get_op(0), (torch.rand(B0, 2), torch.rand(B0, 3)))
1356 test(get_op(0), (torch.rand(2), torch.rand(B0, 3)), in_dims=(None, 0))
1357 test(get_op(0), (torch.rand(2, 17), torch.rand(3, 17, B0)), in_dims=(None, 2))
1358 test(get_op(-1), (torch.rand(17, 2), torch.rand(17, 3, B0)), in_dims=(None, 2))
1361 (torch.rand(B1, 2), torch.rand(B0, 3)),
1366 (torch.rand(B1, 2), torch.rand(B0, B1, 3)),
1444 test(op, (torch.rand(B0, 2, 1024), 15, -1), in_dims=(0, None, None))
1445 test(op, (torch.rand(2, B0, 1024), 9, 1), in_dims=(1, None, None))
1448 (torch.rand(B1, 1023, B0, 5), 4, 0),
1453 (torch.rand(B1, 2, B0, 64, B2),),
1543 test(op, (torch.rand(B0, 5), torch.rand(5)), in_dims=(0, None))
1546 (torch.rand(B1, B0, 5), torch.rand(5)),
1551 test(op, (torch.rand(5), torch.rand(B0, 5)), in_dims=(None, 0))
1554 (torch.rand(5), torch.rand(B1, B0, 5)),
1559 test(op, (torch.rand(B0, 5), torch.rand(B0, 5)))
1560 test(vmap(op), (torch.rand(B1, B0, 5), torch.rand(B0, B1, 5)), in_dims=(1, 0))
1563 (torch.rand(B1, 5), torch.rand(B0, 5)),
1571 test(op, (torch.rand(B0, 1, 5), torch.rand(B0, 2, 3, 5)))
1572 test(op, (torch.rand(B0, 1, 5), torch.rand(2, 3, 5)), in_dims=(0, None))
1573 test(op, (torch.rand(1, 5), torch.rand(B0, 2, 3, 5)), in_dims=(None, 0))
1574 test(vmap(op), (torch.rand(B0, B1, 1, 5), torch.rand(B0, B1, 2, 3, 5)))
1577 (torch.rand(B0, B1, 1, 5), torch.rand(B1, B0, 2, 3, 5)),
1580 test(vmap(op), (torch.rand(B0, B1), torch.rand(B1, 2, 3, 5)), in_dims=(0, None))
1581 test(vmap(vmap(op)), (torch.rand(B0, B1, B2), torch.rand(B0, B1, B2, 2, 3, 5)))
1797 test(op, (torch.rand(B0, 2, 5), 0, 1), in_dims=(0, None, None))
1798 test(op, (torch.rand(2, B0, 5), 0, 1), in_dims=(1, None, None))
1801 (torch.rand(B1, 2, B0, 5), 0, 1),
1806 (torch.rand(B1, 2, B0, 5, B2), 0, 1),
1811 test(op, (torch.rand(B0, 2, 3, 5), [1, 0], [0, 2]), in_dims=(0, None, None))
1812 test(op, (torch.rand(2, 3, B0, 5), [1, 0], [0, 2]), in_dims=(1, None, None))
1815 (torch.rand(B1, 2, B0, 5), [0, 1], [1, 0]),
1820 (torch.rand(B1, 2, B0, 5, B2), [0, 1], [1, 0]),
1839 test(op, (torch.rand(B0, 2, 5), torch.rand(5, 2)), in_dims=(0, None))
1842 (torch.rand(B1, B0, 2, 5), torch.rand(5, 2)),
1847 test(op, (torch.rand(2, 5), torch.rand(B0, 5, 2)), in_dims=(None, 0))
1850 (torch.rand(2, 5), torch.rand(B1, B0, 5, 2)),
1855 test(op, (torch.rand(B0, 2, 5), torch.rand(B0, 5, 2)))
1858 (torch.rand(B1, B0, 2, 5), torch.rand(B0, B1, 5, 2)),
1863 (torch.rand(B1, 2, 5), torch.rand(B0, 5, 2)),
1882 test(op, (torch.rand(B0, 2, 5), torch.rand(5)), in_dims=(0, None))
1885 (torch.rand(B1, B0, 2, 5), torch.rand(5)),
1890 test(op, (torch.rand(2, 5), torch.rand(B0, 5)), in_dims=(None, 0))
1893 (torch.rand(2, 5), torch.rand(B1, B0, 5)),
1898 test(op, (torch.rand(B0, 2, 5), torch.rand(B0, 5)))
1900 vmap(op), (torch.rand(B1, B0, 2, 5), torch.rand(B0, B1, 5)), in_dims=(1, 0)
1904 (torch.rand(B1, 2, 5), torch.rand(B0, 5)),
1913 test(op, (torch.rand(B0, 2, 5), -1, 1, 3), in_dims=(0, None, None, None))
1914 test(op, (torch.rand(2, B0, 5), 1, 1, 3), in_dims=(1, None, None, None))
1917 (torch.rand(B1, 2, B0, 5), 1, 0, 0),
1924 (torch.rand(B1, 2, B0, 5, B2), -1, 2, 3),
1992 test(lambda x: op(x, 2, 3), (torch.rand(B0),))
1993 test(lambda x: op(x, []), (torch.rand(B0),))
1994 test(vmap(lambda x: op(x, 3, 5)), (torch.rand(B0, B1),))
2000 test(op, (torch.rand(B0, 2, 5), 0, 0), in_dims=(0, None, None))
2001 test(op, (torch.rand(2, B0, 5), 1, 1), in_dims=(1, None, None))
2002 test(vmap(lambda t: op(t, 1, 1)), (torch.rand(B1, 2, B0, 5),), in_dims=2)
2005 (torch.rand(B1, 2, B0, B2, 5),),
2020 test(get_op(0), (torch.rand(B0, 3), torch.rand(B0, 3)))
2021 test(get_op(0), (torch.rand(3), torch.rand(B0, 3)), in_dims=(None, 0))
2022 test(get_op(0), (torch.rand(2, 17), torch.rand(2, 17, B0)), in_dims=(None, 2))
2023 test(get_op(-1), (torch.rand(2, 17), torch.rand(2, 17, B0)), in_dims=(None, 2))
2026 (torch.rand(B1, 2), torch.rand(B0, 2)),
2031 (torch.rand(B1, 2), torch.rand(B0, B1, 2)),
2038 test(lambda t: t[0:1], (torch.rand(B0, 3, 5),))
2039 test(lambda t: t[:, 1:3], (torch.rand(3, 5, B0),), in_dims=2)
2041 vmap(lambda t: t[:, 0:1], in_dims=2), (torch.rand(3, 5, B0, B1),), in_dims=2
2045 (torch.rand(3, 5, B0, B1, B2),),
2053 test(op, (torch.rand(B0),))
2054 test(op, (torch.rand(B0, 3, 5),))
2055 test(op, (torch.rand(1, B0, 5),), in_dims=1)
2056 test(op, (torch.rand(B0, 0, 1, 5, 1),))
2057 test(op, (torch.rand(B0, 1, 1, 1, 1),))
2058 test(vmap(op), (torch.rand(B0, B1, 1),))
2059 test(vmap(op), (torch.rand(B1, 1, B0),), in_dims=2)
2090 test(op, (torch.rand(B0, 2 * 5), [2, 5]), in_dims=(0, None), check_view=True)
2092 op, (torch.rand(2, B0, 5), [1, 1, 10]), in_dims=(1, None), check_view=False
2096 (torch.rand(B0, B1, 2, 5),),
2101 (torch.rand(3, B1, 2, B2, 5, B0),),
2110 test(op, (torch.rand(B0, 2 * 5), torch.rand(B0, 2, 5)), check_view=True)
2113 (torch.rand(2 * 5), torch.rand(B0, 2, 5)),
2119 (torch.rand(B0, 2 * 5), torch.rand(2, 5)),
2126 (torch.rand(2, B0, 5), torch.rand(1, 1, 10)),
2133 (torch.rand(B0, B1, 2, 5), torch.randn(B0, B1, 10)),
2138 (torch.rand(3, B1, 2, B2, 5, B0), torch.rand(B0, 3 * 2 * 5)),
2224 test(op, (torch.rand(B0, 2, 1024), 5, -1), in_dims=(0, None, None))
2225 test(op, (torch.rand(2, B0, 1024), 150, 1), in_dims=(1, None, None))
2228 (torch.rand(B1, 1023, B0, 5), 256, 0),
2233 (torch.rand(B1, 2, B0, 64, B2),),
2240 (torch.rand(B0, 2, 1024), [50, 100, 378, 890], -1),
2245 (torch.rand(2, B0, 1024), [50, 100, 212, 345, 0, 378, 890], 1),
2250 (torch.rand(B1, 1023, B0, 5), [50, 100, 212, 345, 0, 378, 890], 0),
2255 (torch.rand(B1, 2, B0, 64, B2),),
2265 test(op, (torch.rand(B0, 2, 1024), 101, -1), in_dims=(0, None, None))
2266 test(op, (torch.rand(2, B0, 1024), 130, 1), in_dims=(1, None, None))
2269 (torch.rand(B1, 1023, B0, 5), 256, 0),
2274 (torch.rand(B1, 2, B0, 64, B2),),
2279 test(op, (torch.rand(B0, 2, 1024), [1, 1020, 3], -1), in_dims=(0, None, None))
2281 op, (torch.rand(2, B0, 1024), [100] * 10 + [24], 1), in_dims=(1, None, None)
2285 (torch.rand(B1, 1023, B0, 5), [256] * 3 + [255], 0),
2290 (torch.rand(B1, 2, B0, 64, B2),),
2299 test(op, (torch.rand(B0, 2, 5),))
2300 test(op, (torch.rand(2, B0, 5),), in_dims=1)
2301 test(vmap(op), (torch.rand(B1, 2, B0, 5),), in_dims=2)
2302 test(vmap(vmap(op, in_dims=2)), (torch.rand(B1, 2, B0, 5, B2),), in_dims=2)
2309 test(lambda x: op(x, 0, 1), (torch.rand(B0, 2, 5),))
2310 test(lambda x: op(x, -1, -2), (torch.rand(B0, 2, 5),))
2311 test(lambda x: op(x, 3, 1), (torch.rand(B0, 2, 5, 4, 6),))
2312 test(lambda x: op(x, 1, 0), (torch.rand(2, B0, 5),), in_dims=1)
2313 test(vmap(lambda x: op(x, 0, 1)), (torch.rand(B1, 2, B0, 5),), in_dims=2)
2316 (torch.rand(B1, 2, B0, 5, B2),),
2322 x = torch.rand(B0)
2330 test(op, (torch.rand(B0, 2, 5),))
2331 test(op, (torch.rand(2, B0, 5),), in_dims=1)
2332 test(vmap(op), (torch.rand(B1, 2, B0, 5),), in_dims=2)
2333 test(vmap(vmap(op, in_dims=2)), (torch.rand(B1, 2, B0, 5, B2),), in_dims=2)
2341 test(op, (torch.rand(B0, 2, 3, 5),))
2342 test(op, (torch.rand(2, B0, 3, 5),), in_dims=1)
2343 test(vmap(op), (torch.rand(B1, 2, B0, 5),), in_dims=2)
2344 test(vmap(op), (torch.rand(B1, 2, B0, 3, 5),), in_dims=2)
2345 test(vmap(vmap(op, in_dims=2)), (torch.rand(B1, 2, B0, 3, B2, 5),), in_dims=2)
2351 test(lambda t: t.to("cpu"), (torch.rand(B0),))
2352 test(lambda t: t.to(torch.double), (torch.rand(B0),))
2354 lambda t, o: t.to(o), (torch.rand(B0), torch.randn(B0, dtype=torch.float64))
2358 (torch.rand(B0), torch.randn(B0, dtype=torch.float64)),
2361 test(vmap(lambda t: t.to(torch.double)), (torch.rand(B0, B1, 3),))
2364 test(lambda t: t.double(), (torch.rand(B0),))
2365 test(lambda t: t.float(), (torch.rand(B0),))
2366 test(lambda t: t.int(), (torch.rand(B0),), check_propagates_grad=False)
2367 test(lambda t: t.long(), (torch.rand(B0),), check_propagates_grad=False)
2374 test(op, (torch.rand(B0, 7, 11), 0, 2, 1), in_dims=(0, None, None, None))
2375 test(op, (torch.rand(7, B0, 11), 1, 4, 2), in_dims=(1, None, None, None))
2378 (torch.rand(B1, 7, B0, 11), 1, 5, 1),
2385 (torch.rand(B1, 7, B0, 11, B2), -1, 2, 4),
2394 test(op, (torch.rand(B0, 2, 1024), -1), in_dims=(0, None))
2395 test(op, (torch.rand(B0, 2, 0),))
2396 test(op, (torch.rand(2, B0, 7), 0), in_dims=(1, None))
2399 (torch.rand(B1, 1023, B0, 5), 1),
2404 (torch.rand(B1, 2, B0, 32, B2),),
2415 vmap(op, in_dims=(1, None))(torch.rand(2, B0, 5), [10])
2417 test(op, (torch.rand(B0, 2 * 5), [2, 5]), in_dims=(0, None))
2418 test(op, (torch.rand(B0, 4, 5), [1, 2, 1, 10]), in_dims=(0, None))
2419 test(vmap(lambda t: t.view([-1])), (torch.rand(B0, B1, 2, 5, 3),))
2422 (torch.rand(B2, B0, B1, 3, 2, 5),),
2433 vmap(op, in_dims=(1, 0))(torch.rand(2, B0, 5), torch.rand(B0, 10))
2435 test(op, (torch.rand(B0, 2 * 5), torch.rand(B0, 2, 5)))
2436 test(op, (torch.rand(2 * 5), torch.rand(B0, 2, 5)), in_dims=(None, 0))
2437 test(op, (torch.rand(B0, 2 * 5), torch.rand(2, 5)), in_dims=(0, None))
2439 test(op, (torch.rand(B0, 4, 5), torch.rand(2, 1, 1, 10)), in_dims=(0, None))
2441 test(vmap(op), (torch.rand(B0, B1, 2, 5), torch.randn(B0, B1, 10)))
2444 (torch.rand(B1, B2, B0, 3, 2, 5), torch.rand(B0, 3 * 2 * 5)),
2451 captured = torch.rand(3)
2455 (torch.bernoulli, (torch.rand(B0, 1),)),
2456 (lambda t: torch.bernoulli(t, p=0.5), (torch.rand(B0, 1),)),
2457 (lambda t: torch.multinomial(t, 2), (torch.rand(B0, 3),)),
2461 (torch.poisson, (torch.rand(B0, 1),)),
2462 (torch.rand_like, (torch.rand(B0, 1),)),
2463 (torch.randn_like, (torch.rand(B0, 1),)),
2464 (lambda t: torch.randint_like(t, 2), (torch.rand(B0, 1),)),
2465 (lambda t: torch.randint_like(t, 0, 2), (torch.rand(B0, 1),)),
2467 (lambda t: torch.bernoulli(captured), (torch.rand(B0),)),
2468 (lambda t: torch.bernoulli(captured, p=0.5), (torch.rand(B0),)),
2469 (lambda t: torch.multinomial(captured, 2), (torch.rand(B0),)),
2473 (lambda t: torch.poisson(captured), (torch.rand(B0),)),
2474 (lambda t: torch.rand_like(captured), (torch.rand(B0),)),
2475 (lambda t: torch.randn_like(captured), (torch.rand(B0),)),
2476 (lambda t: torch.randint_like(captured, 2), (torch.rand(B0),)),
2477 (lambda t: torch.randint_like(captured, 0, 2), (torch.rand(B0),)),
2501 (lambda t: torch.rand(1), (torch.randn(B0),)),
2540 result = torch.rand(*args, **kwargs_without_requires_grad)
2650 target = torch.rand(3, 2, device=device)