mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
Merge branch 'master' into retinanet_mlperf
This commit is contained in:
@@ -113,7 +113,7 @@ def eval_retinanet():
|
||||
if dat.shape[0] == bs:
|
||||
outs = mdlrun(dat).numpy()
|
||||
else:
|
||||
mdlrun.jit_cache = None
|
||||
mdlrun._jit_cache = []
|
||||
outs = mdl(input_fixup(dat)).numpy()
|
||||
et = time.perf_counter()
|
||||
predictions = mdl.postprocess_detections(outs, input_size=dat.shape[1:3], orig_image_sizes=[t["image_size"] for t in targets])
|
||||
|
||||
@@ -3090,7 +3090,7 @@ class Tensor:
|
||||
```
|
||||
"""
|
||||
if not Tensor.training or p == 0: return self
|
||||
return self * (Tensor.rand_like(self, requires_grad=False, dtype=dtypes.default_float) >= p) * (1/(1.0 - p))
|
||||
return (Tensor.rand_like(self, requires_grad=False, dtype=dtypes.default_float) >= p).where(self, 0) * (1/(1.0 - p))
|
||||
|
||||
def one_hot(self, num_classes:int=-1) -> Tensor:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user