MCPcopy Create free account
hub / github.com/albertpumarola/GANimation / BaseModel

Class BaseModel

models/models.py:23–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23class BaseModel(object):
24
25 def __init__(self, opt):
26 self._name = 'BaseModel'
27
28 self._opt = opt
29 self._gpu_ids = opt.gpu_ids
30 self._is_train = opt.is_train
31
32 self._Tensor = torch.cuda.FloatTensor if self._gpu_ids else torch.Tensor
33 self._save_dir = os.path.join(opt.checkpoints_dir, opt.name)
34
35
36 @property
37 def name(self):
38 return self._name
39
40 @property
41 def is_train(self):
42 return self._is_train
43
44 def set_input(self, input):
45 assert False, "set_input not implemented"
46
47 def set_train(self):
48 assert False, "set_train not implemented"
49
50 def set_eval(self):
51 assert False, "set_eval not implemented"
52
53 def forward(self, keep_data_for_visuals=False):
54 assert False, "forward not implemented"
55
56 # used in test time, no backprop
57 def test(self):
58 assert False, "test not implemented"
59
60 def get_image_paths(self):
61 return {}
62
63 def optimize_parameters(self):
64 assert False, "optimize_parameters not implemented"
65
66 def get_current_visuals(self):
67 return {}
68
69 def get_current_errors(self):
70 return {}
71
72 def get_current_scalars(self):
73 return {}
74
75 def save(self, label):
76 assert False, "save not implemented"
77
78 def load(self):
79 assert False, "load not implemented"
80

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected