Port reshape to loc-based implementation