(
weight: torch.Tensor,
weight_scales: torch.Tensor,
weight_zero_points: Optional[torch.Tensor],
weight_quant_min: int,
weight_quant_max: int,
indices: torch.Tensor,
)
| 130 | |
| 131 | @impl(quantized_decomposed_lib, "embedding_byte", "CompositeExplicitAutograd") |
| 132 | def embedding_byte( |
| 133 | weight: torch.Tensor, |
| 134 | weight_scales: torch.Tensor, |
| 135 | weight_zero_points: Optional[torch.Tensor], |
| 136 | weight_quant_min: int, |
| 137 | weight_quant_max: int, |
| 138 | indices: torch.Tensor, |
| 139 | ) -> torch.Tensor: |
| 140 | embedding_weight_checks(weight, weight_scales, weight_zero_points) |
| 141 | group_size = weight.size(1) // ( |
| 142 | weight_scales.size(1) if weight_scales.dim() == 2 else 1 |
| 143 | ) |
| 144 | weight = torch.ops.quantized_decomposed.dequantize_per_channel_group.default( |
| 145 | weight, |
| 146 | weight_scales, |
| 147 | weight_zero_points, |
| 148 | weight_quant_min, |
| 149 | weight_quant_max, |
| 150 | weight.dtype, |
| 151 | group_size, |
| 152 | weight_scales.dtype, |
| 153 | ) |
| 154 | return torch.ops.aten.embedding.default(weight, indices) |
| 155 | |
| 156 | |
| 157 | @register_fake("quantized_decomposed::embedding_byte.out") |
no test coverage detected