Need to resize my tensor on the current graph(backward)

The problem is that I need to resize my tensor on the current graph as shown below:

img = skimage.transform.resize(img, (C, H * scale, W * scale), mode='reflect',anti_aliasing=False)

How can I resize my tensor without detached the current graph. Or resize to the current graph after adjusting my tensor while detached the current graph.

You can use pytorch resize which should match that one.
https://pytorch.org/docs/stable/generated/torch.nn.functional.interpolate.html

As a layer:
https://pytorch.org/docs/stable/generated/torch.nn.Upsample.html?highlight=resize