| 496 | // ------------------------------------------------------------------------ |
| 497 | |
| 498 | static int64 SkewedSize(random::SimplePhilox* gen, int64 current_elements) { |
| 499 | int64 result = 0; |
| 500 | do { |
| 501 | if (current_elements < 100) { |
| 502 | result = gen->Uniform(100000); |
| 503 | } else { |
| 504 | result = gen->Uniform(2); |
| 505 | } |
| 506 | } while ((result * current_elements >= 1LL << 34) || |
| 507 | (result * current_elements < 0)); |
| 508 | return result; |
| 509 | } |
| 510 | |
| 511 | TEST(TensorShapeTest, Randomized) { |
| 512 | // We do a randomized test to verify that the behavior of the |