fix gemm beta for fp16 (#19153)

per onnx spec beta is always fp32 so we need to cast it
This commit is contained in:
Guenther Schmuelling 2024-01-15 18:40:38 -08:00 committed by GitHub
parent 9f87c5c41d
commit 9dee543bed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,8 +100,8 @@ const createGemmProgramInfo = (inputs: readonly TensorView[], attributes: GemmAt
${calculateAlpha}
${(() => {
if (c != null) {
return `let cOffset = ${c.broadcastedIndicesToOffset('vec2(m, n)', output)}; value += uniforms.beta * ${
c.getByOffset('cOffset')};`;
return `let cOffset = ${c.broadcastedIndicesToOffset('vec2(m, n)', output)}; value += ${
dataType}(uniforms.beta) * ${c.getByOffset('cOffset')};`;
}
return '';
})()}