4 ms·
Under the quick primer for graphs, in the sample code, there is a self.param = torch.nn.Parameter(torch.rand(3, 4)) which is then never used? Or am I miss
by sva_ 4y ago
Under the quick primer for graphs, in the sample code, there is a
self.param = torch.nn.Parameter(torch.rand(3, 4))
which is then never used? Or am I missing something?
- cinntaile 4y agoIt's used in the forward pass right under it, no?
- sva_ 4y agoI don't mean the one under "Overview", but the section below it
- rsfern 4y agoI think you’re right, it’s unused. It’s not listed in the nodes below, so I’m not sure if it’s left in to illustrate that the tracer can tell it’s unused. It’s not called out though, and it has the same shape as the first example, so maybe the author copied the module and forgot to delete it Transformations can add new nodes, but I’m not sure they can add or remove parameters?