mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-07 03:00:26 -04:00
update pylint path to check indent/space for all (#6022)
also fixed many errors. it was not checking nested dirs. exclude autogen for now. can we use ruff for this?
This commit is contained in:
@@ -908,10 +908,10 @@ class TestIndexing(unittest.TestCase):
|
||||
numpy_testing_assert_equal_helper(out, ref)
|
||||
|
||||
def test_int_indices(self):
|
||||
v = Tensor.randn(5, 7, 3)
|
||||
numpy_testing_assert_equal_helper(v[[0, 4, 2]].shape, (3, 7, 3))
|
||||
numpy_testing_assert_equal_helper(v[:, [0, 4, 2]].shape, (5, 3, 3))
|
||||
numpy_testing_assert_equal_helper(v[:, [[0, 1], [4, 3]]].shape, (5, 2, 2, 3))
|
||||
v = Tensor.randn(5, 7, 3)
|
||||
numpy_testing_assert_equal_helper(v[[0, 4, 2]].shape, (3, 7, 3))
|
||||
numpy_testing_assert_equal_helper(v[:, [0, 4, 2]].shape, (5, 3, 3))
|
||||
numpy_testing_assert_equal_helper(v[:, [[0, 1], [4, 3]]].shape, (5, 2, 2, 3))
|
||||
|
||||
# TODO fancy setitem
|
||||
'''
|
||||
@@ -983,7 +983,7 @@ class TestIndexing(unittest.TestCase):
|
||||
numpy_testing_assert_equal_helper(x[[1, 2]].shape, (2, 0))
|
||||
numpy_testing_assert_equal_helper(x[[], []].shape, (0,))
|
||||
with self.assertRaises(IndexError):
|
||||
x[:, [0, 1]]
|
||||
x[:, [0, 1]]
|
||||
|
||||
def test_empty_slice(self):
|
||||
x = Tensor.randn(2, 3, 4, 5)
|
||||
@@ -1036,8 +1036,8 @@ class TestIndexing(unittest.TestCase):
|
||||
a[...] = neg_ones_expanded * 4
|
||||
numpy_testing_assert_equal_helper(a, neg_ones * 4)
|
||||
if a.dim() == 0:
|
||||
with self.assertRaises(IndexError):
|
||||
a[:] = neg_ones_expanded * 5
|
||||
with self.assertRaises(IndexError):
|
||||
a[:] = neg_ones_expanded * 5
|
||||
|
||||
@unittest.skip("bool indexing not supported")
|
||||
def test_index_scalar_with_bool_mask(self):
|
||||
|
||||
@@ -46,7 +46,7 @@ class TestSymbolic(unittest.TestCase):
|
||||
self.helper_test_variable(expr, 0, 1, "(((idx1*4)+FLOAT4_INDEX)<512)")
|
||||
|
||||
def test_div_reduction(self):
|
||||
self.helper_test_variable(Variable("a", 2, 3)//2, 1, 1, "1")
|
||||
self.helper_test_variable(Variable("a", 2, 3)//2, 1, 1, "1")
|
||||
|
||||
def test_var_becomes_num(self):
|
||||
assert isinstance(Variable("a", 2, 2), NumNode)
|
||||
|
||||
@@ -100,7 +100,7 @@ class TestSymbolic(unittest.TestCase):
|
||||
self.helper_test_variable(expr, 0, 1, "(((idx1*4)+FLOAT4_INDEX)<512)")
|
||||
|
||||
def test_div_reduction(self):
|
||||
self.helper_test_variable(Variable("a", 2, 3)//2, 1, 1, "1")
|
||||
self.helper_test_variable(Variable("a", 2, 3)//2, 1, 1, "1")
|
||||
|
||||
#def test_var_becomes_num(self):
|
||||
# assert isinstance(Variable("a", 2, 2), NumNode)
|
||||
|
||||
Reference in New Issue
Block a user