mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
linearizer! (#714)
* linearizer outputs something * working ish * cstyle codegen * clang mostly works * fix load valid * fix numberless loop * fancy gen * working * fix enet compiler * cleanups * float4 upcasting * less lines * supports_float4 * constant folding * mulacc * internet tests flaky in CI * 90% image support * fix image generic * bugs exposed with shapetracker and single view * new llvm * use vload, remove OLD * that's really poorly done * ending up being more lines
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
import io
|
||||
import unittest
|
||||
from tinygrad.helpers import getenv
|
||||
from extra.utils import fetch, fake_torch_load_zipped
|
||||
from PIL import Image
|
||||
|
||||
class TestUtils(unittest.TestCase):
|
||||
@unittest.skip("hangs sometimes")
|
||||
@unittest.skipIf(getenv("CI", "") != "", "no internet tests in CI")
|
||||
class TestFetch(unittest.TestCase):
|
||||
def test_fetch_bad_http(self):
|
||||
self.assertRaises(AssertionError, fetch, 'http://httpstat.us/500')
|
||||
self.assertRaises(AssertionError, fetch, 'http://httpstat.us/404')
|
||||
@@ -19,6 +20,7 @@ class TestUtils(unittest.TestCase):
|
||||
pimg = Image.open(io.BytesIO(img))
|
||||
assert pimg.size == (705, 1024)
|
||||
|
||||
class TestUtils(unittest.TestCase):
|
||||
def test_fake_torch_load_zipped(self):
|
||||
import torch
|
||||
import numpy as np
|
||||
@@ -54,6 +56,5 @@ class TestUtils(unittest.TestCase):
|
||||
assert a.dtype == b.dtype
|
||||
assert np.array_equal(a, b)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user