mirror of https://github.com/commaai/tinygrad.git
parent
c5a941d466
commit
50754f1494
|
@ -97,7 +97,7 @@ jobs:
|
|||
- name: Compile C to native
|
||||
run: clang -O2 recognize.c -lm -o recognize
|
||||
- name: Test EfficientNet
|
||||
run: curl https://media.istockphoto.com/photos/hen-picture-id831791190 | ./recognize | grep hen
|
||||
run: cat test/models/efficientnet/Chicken.jpg | ./recognize | grep cock
|
||||
|
||||
testtorch:
|
||||
name: Torch Tests
|
||||
|
|
|
@ -82,10 +82,12 @@ class View:
|
|||
contiguous = offset == 0 and mask is None and strides == strides_for_shape(shape)
|
||||
return View(shape, strides, offset, mask, contiguous)
|
||||
|
||||
@functools.lru_cache(None) # pylint: disable=method-cache-max-size-none
|
||||
def vars(self) -> Set[Variable]:
|
||||
flatten_mask = tuple(x for m in self.mask for x in m) if self.mask is not None else tuple()
|
||||
return functools.reduce(operator.or_, [x.vars() for x in self.shape+self.strides+(self.offset,)+flatten_mask if isinstance(x, Node)], set())
|
||||
|
||||
@functools.lru_cache(None) # pylint: disable=method-cache-max-size-none
|
||||
def unbind(self) -> View:
|
||||
unbound_vars:Dict[Variable,Node] = {v: v.unbind()[0] for v in self.vars() if v.val is not None}
|
||||
new_shape = tuple([s if isinstance(s, int) else s.substitute(unbound_vars) for s in self.shape])
|
||||
|
|
Loading…
Reference in New Issue