In my view,  yes. You can do whatever you want if your solution to a task calls for such operations inside forward. forward is just an API like any other python API’s. As long as the autograd doesn’t throw errors, you can choose to code anything in forward.