MCPcopy
hub / github.com/huggingface/pytorch-image-models / to

Method to

timm/task/task.py:56–61  ·  view source on GitHub ↗

Move task to device/dtype, keeping self.device and self.dtype in sync.

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

54 self.verbose = verbose
55
56 def to(self, *args, **kwargs):
57 """Move task to device/dtype, keeping self.device and self.dtype in sync."""
58 dummy = torch.empty(0).to(*args, **kwargs)
59 self.device = dummy.device
60 self.dtype = dummy.dtype
61 return super().to(*args, **kwargs)
62
63 def prepare_distributed(
64 self,

Callers 15

validateFunction · 0.80
mainFunction · 0.80
train_one_epochFunction · 0.80
validateFunction · 0.80
profile_fvcoreFunction · 0.80
__init__Method · 0.80
__init__Method · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
train_one_epochFunction · 0.80
validateFunction · 0.80

Calls

no outgoing calls

Tested by 15

test_model_forwardFunction · 0.64
test_model_backwardFunction · 0.64
test_model_default_cfgsFunction · 0.64
_run_act_layer_gradFunction · 0.64
_test_state_dictFunction · 0.64
_test_basic_casesFunction · 0.64
_test_modelFunction · 0.64