|
325 | 325 | "quantized_add.per_tensor_out(Tensor X, float X_scale, int X_zero_point, Tensor Y, float Y_scale, " |
326 | 326 | "int Y_zero_point, float out_scale, int out_zero_point, *, Tensor(a!) out) -> Tensor(a!)" |
327 | 327 | ) |
| 328 | +lib.define( |
| 329 | + "quantized_add_asym8sxasym8s_asym8s.per_tensor(Tensor X, float X_scale, int X_zero_point, Tensor Y, float Y_scale, " |
| 330 | + "int Y_zero_point, float out_scale, int out_zero_point) -> Tensor" |
| 331 | +) |
| 332 | +lib.define( |
| 333 | + "quantized_add_asym8sxasym8s_asym8s.per_tensor_out(Tensor X, float X_scale, int X_zero_point, Tensor Y, float Y_scale, " |
| 334 | + "int Y_zero_point, float out_scale, int out_zero_point, *, Tensor(a!) out) -> Tensor(a!)" |
| 335 | +) |
| 336 | +lib.define( |
| 337 | + "quantized_add_asym8uxasym8u_asym8u.per_tensor(Tensor X, float X_scale, int X_zero_point, Tensor Y, float Y_scale, " |
| 338 | + "int Y_zero_point, float out_scale, int out_zero_point) -> Tensor" |
| 339 | +) |
| 340 | +lib.define( |
| 341 | + "quantized_add_asym8uxasym8u_asym8u.per_tensor_out(Tensor X, float X_scale, int X_zero_point, Tensor Y, float Y_scale, " |
| 342 | + "int Y_zero_point, float out_scale, int out_zero_point, *, Tensor(a!) out) -> Tensor(a!)" |
| 343 | +) |
328 | 344 | lib.define( |
329 | 345 | "quantized_mul.out(Tensor X, Tensor X_scale, Tensor X_zero_point, Tensor Y, Tensor Y_scale, " |
330 | 346 | "Tensor Y_zero_point, float out_scale, int out_zero_point, *, Tensor(a!) out) -> Tensor(a!)" |
@@ -503,6 +519,36 @@ def quantized_add_per_tensor_meta( |
503 | 519 | return X.new_empty(out_size, dtype=X.dtype) |
504 | 520 |
|
505 | 521 |
|
| 522 | +@register_fake("cadence::quantized_add_asym8sxasym8s_asym8s.per_tensor") |
| 523 | +def quantized_add_asym8sxasym8s_asym8s_per_tensor_meta( |
| 524 | + X: torch.Tensor, |
| 525 | + X_scale: float, |
| 526 | + X_zero_point: int, |
| 527 | + Y: torch.Tensor, |
| 528 | + Y_scale: float, |
| 529 | + Y_zero_point: int, |
| 530 | + out_scale: float, |
| 531 | + out_zero_point: int, |
| 532 | +) -> torch.Tensor: |
| 533 | + out_size = torch.broadcast_shapes(X.size(), Y.size()) |
| 534 | + return X.new_empty(out_size, dtype=X.dtype) |
| 535 | + |
| 536 | + |
| 537 | +@register_fake("cadence::quantized_add_asym8uxasym8u_asym8u.per_tensor") |
| 538 | +def quantized_add_asym8uxasym8u_asym8u_per_tensor_meta( |
| 539 | + X: torch.Tensor, |
| 540 | + X_scale: float, |
| 541 | + X_zero_point: int, |
| 542 | + Y: torch.Tensor, |
| 543 | + Y_scale: float, |
| 544 | + Y_zero_point: int, |
| 545 | + out_scale: float, |
| 546 | + out_zero_point: int, |
| 547 | +) -> torch.Tensor: |
| 548 | + out_size = torch.broadcast_shapes(X.size(), Y.size()) |
| 549 | + return X.new_empty(out_size, dtype=X.dtype) |
| 550 | + |
| 551 | + |
506 | 552 | @register_fake("cadence::quantized_linear") |
507 | 553 | def quantized_linear_meta( |
508 | 554 | src: torch.Tensor, |
|
0 commit comments