MCPcopy Create free account
hub / github.com/pytorch/pytorch / prepare_input

Method prepare_input

caffe2/python/rnn_cell.py:1260–1281  ·  view source on GitHub ↗
(self, model, input_blob)

Source from the content-addressed store, hash-verified

1258 return self.attention_weights_3d
1259
1260 def prepare_input(self, model, input_blob):
1261 if self.encoder_outputs_transposed is None:
1262 self.encoder_outputs_transposed = brew.transpose(
1263 model,
1264 self.encoder_outputs,
1265 self.scope('encoder_outputs_transposed'),
1266 axes=[1, 2, 0],
1267 )
1268 if (
1269 self.weighted_encoder_outputs is None and
1270 self.attention_type != AttentionType.Dot
1271 ):
1272 self.weighted_encoder_outputs = brew.fc(
1273 model,
1274 self.encoder_outputs,
1275 self.scope('weighted_encoder_outputs'),
1276 dim_in=self.encoder_output_dim,
1277 dim_out=self.encoder_output_dim,
1278 axis=2,
1279 )
1280
1281 return self.decoder_cell.prepare_input(model, input_blob)
1282
1283 def build_initial_coverage(self, model):
1284 """

Callers

nothing calls this directly

Calls 3

transposeMethod · 0.45
scopeMethod · 0.45
prepare_inputMethod · 0.45

Tested by

no test coverage detected