def makeReversibleComponent(channels, blockCount): """Create a reversible sequence of blockCount blocks Arguments: channels {int} -- Number of in and out channels (in_chan = out_chan) blockCount {int} -- Number of blocks in the sequence Returns: [nn.Module] -- Reversible sequence """ modules = [] for i in range(blockCount): modules.append(makeReversibleSequence(channels)) return rv.ReversibleSequence(nn.ModuleList(modules))
def revSequence(channels, n_block): """Make a sequence of multiple reversible block Arguments: channels {[int]} -- [number of channels fixed] n_block {[int]} -- [Number of blocks] Returns: [nn.Module] -- [The reversible sequence] """ sequence = [] for i in range(n_block): sequence.append(revBlock(channels)) return rv.ReversibleSequence(nn.ModuleList(sequence))
def makeReversibleComponent(channels, blockCount): modules = [] for i in range(blockCount): modules.append(makeReversibleSequence(channels)) return rv.ReversibleSequence(nn.ModuleList(modules))