def flatten(W): """ Get the flattened version of this weight matrix :param W: :return: W with D,O """ if W.ndim==4: W = W.reshape(W.shape[0],-1) W = W.T return W