MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / tensor2single

Function tensor2single

ldm/modules/image_degradation/utils_image.py:312–317  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

310
311# convert torch tensor to single
312def tensor2single(img):
313 img = img.data.squeeze().float().cpu().numpy()
314 if img.ndim == 3:
315 img = np.transpose(img, (1, 2, 0))
316
317 return img
318
319# convert torch tensor to single
320def tensor2single3(img):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected