apply NOOPT in test_arange complexity (#4774)

with hcopt, arange(2560) uses less ops than arange(256)
This commit is contained in:
chenyu
2024-05-29 23:12:35 -04:00
committed by GitHub
parent cde7a7cda7
commit f1bf916b8a

View File

@@ -1,10 +1,12 @@
import unittest
from tinygrad import Tensor, GlobalCounters
from tinygrad.helpers import Context
class TestArange(unittest.TestCase):
def _get_flops(self, N):
GlobalCounters.reset()
Tensor.arange(N).realize()
with Context(NOOPT=1):
Tensor.arange(N).realize()
return GlobalCounters.global_ops
def test_complexity(self):