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

Function isimage

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

Source from the content-addressed store, hash-verified

39
40
41def isimage(x):
42 if not isinstance(x,torch.Tensor):
43 return False
44 return (len(x.shape) == 4) and (x.shape[1] == 3 or x.shape[1] == 1)
45
46
47def exists(x):

Callers 3

log_imagesMethod · 0.90
log_imagesMethod · 0.90
log_imagesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected