You can use any PyTorch operations in the forward pass, which have a valid backward function.
While the majority of the operations meet this condition, e.g. torch.argmax will detach the output from the computation graph, as this operation is not differentiable.