Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should this symbolic test fail? #4501

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

reddyn12
Copy link
Contributor

No description provided.

Copy link
Contributor

This branch currently is behind tinygrad/master. The line count difference bot is disabled.

@geohot
Copy link
Collaborator

geohot commented May 17, 2024

What's it returning? It is just really close to 1?

@reddyn12
Copy link
Contributor Author

It errors:

python3 test/test_tensor_variable.py TestTensorVariable.test_symbolic_mean_2d_add
F
======================================================================
FAIL: test_symbolic_mean_2d_add (__main__.TestTensorVariable.test_symbolic_mean_2d_add)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nikhil/Code/Fun/tinygrad/test/test_tensor_variable.py", line 68, in test_symbolic_mean_2d_add
    t = Tensor.ones(2, 2).contiguous().reshape(vv2+add_term, vv+add_term)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nikhil/Code/Fun/tinygrad/tinygrad/tensor.py", line 675, in reshape
    return F.Reshape.apply(self, shape=new_shape) if new_shape != self.shape else self
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nikhil/Code/Fun/tinygrad/tinygrad/tensor.py", line 36, in apply
    ret.lazydata, ret.requires_grad, ret.grad = ctx.forward(*[t.lazydata for t in x], **kwargs), ctx.requires_grad, None
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nikhil/Code/Fun/tinygrad/tinygrad/function.py", line 187, in forward
    return x.reshape(shape)
           ^^^^^^^^^^^^^^^^
  File "/Users/nikhil/Code/Fun/tinygrad/tinygrad/lazy.py", line 215, in reshape
    def reshape(self, arg:Tuple[sint, ...]): return self._view(self.st.reshape(arg))
                                                               ^^^^^^^^^^^^^^^^^^^^
  File "/Users/nikhil/Code/Fun/tinygrad/tinygrad/shape/shapetracker.py", line 117, in reshape
    if getenv("MERGE_VIEW", 1) and (new_view := self.views[-1].reshape(new_shape)) is not None: return ShapeTracker(self.views[0:-1] + (new_view,))
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nikhil/Code/Fun/tinygrad/tinygrad/shape/view.py", line 270, in reshape
    assert all(isinstance(s, (int, Variable)) for s in new_shape), f"{self.shape=} -> {new_shape=} contains non (int, Variable) dim"
AssertionError: self.shape=(2, 2) -> new_shape=((Variable('b', 1, 10).bind(1)+Variable('c', 0, 10).bind(1)), (Variable('a', 1, 10).bind(1)+Variable('c', 0, 10).bind(1))) contains non (int, Variable) dim

----------------------------------------------------------------------
Ran 1 test in 1.165s

FAILED (failures=1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants