[Perf] zeros -> empty to remove additional fill (#42988)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-05-21 16:00:29 -04:00
committed by GitHub
parent 9b54e50e2c
commit b29cbf0652
4 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -57,11 +57,11 @@ def create_fp4_scale_tensor(
rounded_m = round_up(m, 128)
scale_n = n // block_size
rounded_n = round_up(scale_n, 4)
return torch.zeros(
return torch.empty(
(rounded_m, rounded_n // 4), device=device, dtype=torch.int32
)
else:
return torch.zeros((m, n // block_size), device=device, dtype=torch.uint8)
return torch.empty((m, n // block_size), device=device, dtype=torch.uint8)
def create_fp4_output_tensors(