(self, x)
| 120 | self.output_activation = self.make_activation(output_activation) |
| 121 | |
| 122 | def forward(self, x): |
| 123 | if self.use_residual: |
| 124 | residual = x.type(torch.float32) |
| 125 | x = self.layers(x) |
| 126 | if self.use_residual: |
| 127 | x = x + residual |
| 128 | x = self.output_activation(x) |
| 129 | return x |
| 130 | |
| 131 | def make_linear(self, dim_in, dim_out, is_first, is_last, bias=True): |
| 132 | layer = nn.Linear(dim_in, dim_out, bias=bias) |