I am trying to solve the Exercise 4 in Section 5.1, which is “Implement a block that takes two blocks as an argument, say net1 and net2 and returns the concatenated output of both networks in the forward pass (this is also called a parallel block).”
I am trying to implement the multiple inheritance via:
class Concatenate(nn.Block, nn.Block):
def init(self, **kwargs):
super(Concatenate, self).init(**kwargs)
But this seems not the correct way to implement multiple inheritance, can anyone give me any hint?
This is not really a case of multiple inheritance, your class should be defined that way class Concatenate(nn.Block), however you want the constructor to have 2 blocks as input and look like that: def __init__(self, block1, block2, **kwargs):