MCPcopy Create free account
hub / github.com/WendyShang/flare / forward

Method forward

encoder.py:227–250  ·  view source on GitHub ↗
(self, obs, detach=False)

Source from the content-addressed store, hash-verified

225
226
227 def forward(self, obs, detach=False):
228 h = self.forward_conv(obs)
229
230 if detach:
231 h = h.detach()
232
233 try:
234 h_fc = self.fc(h)
235 except:
236 print(obs.shape)
237 print(h.shape)
238 assert False
239 self.outputs['fc'] = h_fc
240
241 h_norm = self.ln(h_fc)
242 self.outputs['ln'] = h_norm
243
244 if self.output_logits:
245 out = h_norm
246 else:
247 out = torch.tanh(h_norm)
248 self.outputs['tanh'] = out
249
250 return out
251
252 def copy_conv_weights_from(self, source):
253 """Tie convolutional layers"""

Callers

nothing calls this directly

Calls 1

forward_convMethod · 0.95

Tested by

no test coverage detected