Files
tinygrad/test/null/test_resnet.py
George Hotz d59e6e7a37 move more tests to test/null, split some existing ones (#14512)
* move more tests to test/null, split some existing ones

* null work

* null work

* move more

* fixes

* move PIL

* PIL in CLIP

* don't move that
2026-02-03 20:20:20 +08:00

25 lines
713 B
Python

import unittest
from extra.models import resnet
from tinygrad import dtypes
from tinygrad.device import is_dtype_supported
# pretrained weights contain num_batches_tracked as int64
@unittest.skipUnless(is_dtype_supported(dtypes.int64), "need int64 support")
class TestResnet(unittest.TestCase):
def test_model_load(self):
model = resnet.ResNet18()
model.load_from_pretrained()
model = resnet.ResNeXt50_32X4D()
model.load_from_pretrained()
def test_model_load_no_fc_layer(self):
model = resnet.ResNet18(num_classes=None)
model.load_from_pretrained()
model = resnet.ResNeXt50_32X4D(num_classes=None)
model.load_from_pretrained()
if __name__ == '__main__':
unittest.main()