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
commit f1bf916b8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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):