mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-10-01 01:43:41 +08:00
0b2c431d3a
version: sunnypilot v2026.003.000 (dev)
date: 2026-09-14T15:43:39
master commit: a5f44653d7
14 lines
333 B
Python
14 lines
333 B
Python
import unittest
|
|
from tinygrad import Variable
|
|
from tinygrad.tensor import Tensor
|
|
|
|
class TestSymbolicPad(unittest.TestCase):
|
|
def test_pad(self):
|
|
v = Variable("v", 1, 100).bind(5)
|
|
t = Tensor.ones(100)[:v].pad(((4, 0),))
|
|
t = t[:9]
|
|
assert t.tolist() == [0,0,0,0,1,1,1,1,1]
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|