In my environment with PyTorch 0.2.0, it seems that PyTorch is smart enough to omit calling the backward function for the example forward function (i.e., the identity function).
However, the backward function is called for the forward function with “inp+0.0”