MCPcopy Create free account
hub / github.com/SLDGroup/EMCAD / _pad

Function _pad

utils/misc.py:155–160  ·  view source on GitHub ↗
(x, crop_size)

Source from the content-addressed store, hash-verified

153
154def sliced_forward(single_forward):
155 def _pad(x, crop_size):
156 h, w = x.size()[2:]
157 pad_h = max(crop_size - h, 0)
158 pad_w = max(crop_size - w, 0)
159 x = F.pad(x, (0, pad_w, 0, pad_h))
160 return x, pad_h, pad_w
161
162 def wrapper(self, x):
163 batch_size, _, ori_h, ori_w = x.size()

Callers 1

wrapperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected