Files
StarPilot/tinygrad_repo/test/device/metal/test_softmax_fusion.py
T
2026-10-20 03:55:45 +00:00

14 lines
406 B
Python

import unittest
from tinygrad import Tensor, Device
class TestFuse(unittest.TestCase):
@unittest.skipUnless(Device.DEFAULT == "METAL", "METAL TC")
def test_fuse_and_tc_opt(self):
A = Tensor.randn(8, 8).realize()
B = Tensor.randn(8, 8).realize()
C = Tensor.ones(1, 8, 8).pad(((1,1), None, None),).sum(0)
out = (C + (A @ B))
out.realize()
if __name__ == "__main__": unittest.main()