Sorry, @hrushi, unfortunately I don’t think there’s a great workaround available today (at least not one better than you’re using). This is a popular request, and I’ve updated the Github issue tracking it (see Support `clamp()` with tensor min and max · Issue #2793 · pytorch/pytorch · GitHub 31) to be “high priority” so this functionality is provided quickly.