Strange it sometimes work, and sometimes doesn’t:

torch.reshape(weights, weights.shape[::-1])

tensor([[-0.8948],
            [-0.3556],
            [ 1.2324],
            [ 0.1382],
            [-1.6822]])


torch.mm(features, torch.reshape(weights, weights[::-1]))

_ ValueError                                Traceback (most recent call last)_
_ <ipython-input-42-67cae86c60db> in <module>_
_torch.mm(features, torch.reshape(weights, weights[::-1]))_
_ ValueError: negative step not yet supported_


torch.mm(features, weights.view(weights.shape[::-1]))

tensor([[-0.8948],
            [-0.3556],
            [ 1.2324],
            [ 0.1382],
            [-1.6822]])