MCPcopy Create free account
hub / github.com/DPS2022/diffusion-posterior-sampling / normalize

Function normalize

util/tools.py:53–54  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

51
52# Change the values of tensor x from range [0, 1] to [-1, 1]
53def normalize(x):
54 return x.mul_(2).add_(-1)
55
56def same_padding(images, ksizes, strides, rates):
57 assert len(images.size()) == 4

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected