Files
tinygrad/test
Skosh e8c350fdac fix: make Tensor.rand produce correct values for float16 (#3654)
* fix: make Tensor.rand produce correct values for float16

Due to precision loss when casting to float16, the data distribution created by custom_random isnt correctly in the interval ]0, 1[, but instead in the interval ]0, 1], which causes the Tensor.randn to incorrectly generate values of infinity.

The solution uses a scaling value to make sure the values stay under 1, when using half precision.

Closes #3611

* update implementation to truncate to closest f16 value to 1

* chore: fix whitespace

* test larger distribution

---------

Co-authored-by: chenyu <chenyu@fastmail.com>
2024-03-10 18:48:00 -04:00
..
2024-01-30 08:58:10 -08:00
2024-03-02 03:50:05 -08:00
2024-01-17 11:58:08 -08:00
2024-03-09 15:30:34 -08:00
2023-12-01 11:34:47 -08:00
2020-12-15 23:44:08 -08:00
2023-06-25 10:38:58 -07:00
2023-12-20 14:33:21 -08:00
2024-03-09 15:30:34 -08:00
2023-02-27 06:53:18 -08:00
2024-02-15 12:37:53 +01:00
2024-03-10 14:47:24 -07:00
2023-12-07 17:07:05 -08:00
2024-03-09 15:30:34 -08:00
2024-03-06 13:34:21 -08:00
2024-03-06 13:34:21 -08:00
2024-01-15 11:31:54 -08:00
2024-02-20 09:36:30 +01:00
2024-03-10 14:47:24 -07:00
2024-02-20 09:36:30 +01:00