Type hints for PyTorch

384 Views Asked by At

How can I use type hints with PyTorch? If I inspect the class for the model returned, I get models.common.AutoShape. However, models shows up as unknown.

import torch

model : models.common.AutoShape = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)

I also want to explicitly type the results.

0

There are 0 best solutions below