(self, x: torch.Tensor, y: torch.Tensor)
| 47 | self.alpha = alpha |
| 48 | |
| 49 | def forward(self, x: torch.Tensor, y: torch.Tensor) -> torch.Tensor: |
| 50 | if self.alpha is not None: |
| 51 | return torch.add(x, y, alpha=self.alpha) |
| 52 | return x + y |
| 53 | |
| 54 | |
| 55 | class AddScalarModel(nn.Module): |