len(self.random_matrix) is 0, since you are not passing input_dim_list and use the default value, which is an empty list.
This also means that self.input_num = len(input_dim_list) will be 0 and thus:
self.random_matrix = torch.nn.ParameterList([torch.nn.Parameter(torch.rand(input_dim_list[i], output_dim)) for i in range(self.input_num)])

will be empty.