MCPcopy Create free account
hub / github.com/ICTMCG/FakeSV / forward

Method forward

code/models/trm.py:76–80  ·  view source on GitHub ↗
(self, input_len)

Source from the content-addressed store, hash-verified

74 self.pos_enc.weight = nn.Parameter(torch.from_numpy(pos_enc), requires_grad=False)
75 self.max_len = int(max_seq_len/10)
76 def forward(self, input_len):
77 max_len = self.max_len # torch.max(input_len)
78 tensor = torch.cuda.LongTensor if input_len.is_cuda else torch.LongTensor
79 input_pos = tensor([list(range(1, len+1)) + [0]*(max_len-len) for len in input_len])
80 return self.pos_enc(input_pos)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected