initial changes for issue #2196

This function is used in the grad op. It didn't got updated, so this cause crash. For now, you could just update the grad op to call this function with ds for st. This will make it still work without support for the strides.