Skip to content

Commit

Permalink
jit oops. should add that to commit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed May 6, 2023
1 parent 5b2ae26 commit 0cd3feb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tinygrad/jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __call__(self, *args, **kwargs) -> Any:
# NOTE: this cast is needed since although we know realize will create a ".realized" DeviceBuffer, the type checker doesn't
input_rawbuffers: Dict[Union[int, str], RawBuffer] = {cast(Union[int, str], k):cast(RawBuffer, v.realize().lazydata.realized) for k,v in itertools.chain(enumerate(args), kwargs.items()) if isinstance(v, Tensor)}
assert len(input_rawbuffers) != 0, "no inputs to JIT"
assert set(input_rawbuffers.values()) == len(input_rawbuffers), "duplicate inputs to JIT"
assert len(set(input_rawbuffers.values())) == len(input_rawbuffers), "duplicate inputs to JIT"
if self.cnt >= 2:
for (j,i),(input_name, expected_size, expected_type) in self.input_replace.items():
assert input_rawbuffers[input_name].size == expected_size and input_rawbuffers[input_name].dtype == expected_type, f"size or type mismatch in JIT, {input_rawbuffers[input_name]} != <{expected_size}, {expected_type}>"
Expand Down

0 comments on commit 0cd3feb

Please sign in to comment.