(self, x)
| 428 | self.b = None |
| 429 | |
| 430 | def forward(self, x): |
| 431 | if self.b: |
| 432 | self.device_check(x, self.W, self.b) |
| 433 | else: |
| 434 | self.device_check(x, self.W) |
| 435 | |
| 436 | if self.transA == 0: |
| 437 | in_features = x.shape[-1] |
| 438 | else: |
| 439 | in_features = x.shape[0] |
| 440 | |
| 441 | if self.transB == 0: |
| 442 | in_features_w = self.W.shape[0] |
| 443 | else: |
| 444 | in_features_w = self.W.shape[-1] |
| 445 | |
| 446 | assert in_features == in_features_w, ( |
| 447 | "Gemm layer expects input features size %d received %d" % |
| 448 | (in_features_w, in_features)) |
| 449 | y = autograd.gemm(x, self.W, self.b, self.alpha, self.beta, self.transA, |
| 450 | self.transB) |
| 451 | |
| 452 | return y |
| 453 | |
| 454 | def get_params(self): |
| 455 | if self.bias: |
nothing calls this directly
no test coverage detected