6adb63b915
date: 2026-06-04T09:49:56 master commit: c0ab3550eca2e9daf197c46b7e4b24aa9637cf2e
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()
|