MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / __init__

Method __init__

examples/SuperResolution/GAN.py:78–97  ·  view source on GitHub ↗

Args: input (InputSource): model (GANModelDesc):

(self, input, model, num_gpu=1)

Source from the content-addressed store, hash-verified

76class GANTrainer(TowerTrainer):
77
78 def __init__(self, input, model, num_gpu=1):
79 """
80 Args:
81 input (InputSource):
82 model (GANModelDesc):
83 """
84 super(GANTrainer, self).__init__()
85 assert isinstance(model, GANModelDesc), model
86
87 if num_gpu > 1:
88 input = StagingInput(input)
89
90 # Setup input
91 cbs = input.setup(model.get_input_signature())
92 self.register_callback(cbs)
93
94 if num_gpu <= 1:
95 self._build_gan_trainer(input, model)
96 else:
97 self._build_multigpu_gan_trainer(input, model, num_gpu)
98
99 def _build_gan_trainer(self, input, model):
100 """

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 5

_build_gan_trainerMethod · 0.95
StagingInputClass · 0.90
setupMethod · 0.80
get_input_signatureMethod · 0.80

Tested by

no test coverage detected