mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-07 03:00:26 -04:00
Update examples to new API (#205)
This commit is contained in:
@@ -38,7 +38,7 @@ def infer(model, img):
|
||||
|
||||
# run the net
|
||||
if GPU:
|
||||
out = model.forward(Tensor(img).cuda()).cpu()
|
||||
out = model.forward(Tensor(img).gpu()).cpu()
|
||||
else:
|
||||
out = model.forward(Tensor(img))
|
||||
|
||||
@@ -55,7 +55,7 @@ if __name__ == "__main__":
|
||||
model = EfficientNet(int(os.getenv("NUM", "0")))
|
||||
model.load_weights_from_torch()
|
||||
if GPU:
|
||||
[x.cuda_() for x in get_parameters(model)]
|
||||
[x.gpu_() for x in get_parameters(model)]
|
||||
|
||||
# category labels
|
||||
import ast
|
||||
|
||||
Reference in New Issue
Block a user