MCPcopy Create free account
hub / github.com/IceClear/StableSR / isimage

Function isimage

ldm/util.py:47–50  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

45
46
47def isimage(x):
48 if not isinstance(x, torch.Tensor):
49 return False
50 return (len(x.shape) == 4) and (x.shape[1] == 3 or x.shape[1] == 1)
51
52
53def exists(x):

Callers 1

log_imagesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected