MCPcopy Create free account
hub / github.com/Intelligent-Computing-Lab-Panda/NDA_SNN / SeqToANNContainer

Class SeqToANNContainer

models/layers.py:5–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4
5class SeqToANNContainer(nn.Module):
6 def __init__(self, *args):
7 super().__init__()
8 if len(args) == 1:
9 self.module = args[0]
10 else:
11 self.module = nn.Sequential(*args)
12
13 def forward(self, x_seq: torch.Tensor):
14 y_shape = [x_seq.shape[0], x_seq.shape[1]]
15 y_seq = self.module(x_seq.flatten(0, 1).contiguous())
16 y_shape.extend(y_seq.shape[1:])
17 return y_seq.view(y_shape)
18
19
20class SpikeModule(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected