MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / AddReadout

Class AddReadout

dmidas/backbones/utils.py:15–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14
15class AddReadout(nn.Module):
16 def __init__(self, start_index=1):
17 super(AddReadout, self).__init__()
18 self.start_index = start_index
19
20 def forward(self, x):
21 if self.start_index == 2:
22 readout = (x[:, 0] + x[:, 1]) / 2
23 else:
24 readout = x[:, 0]
25 return x[:, self.start_index:] + readout.unsqueeze(1)
26
27
28class ProjectReadout(nn.Module):

Callers 1

get_readout_operFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected