Merge branch 'master' into retinanet_mlperf

This commit is contained in:
Francis Lata
2024-09-27 08:16:24 -07:00
2 changed files with 2 additions and 2 deletions

View File

@@ -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])

View File

@@ -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:
"""