From 71dd18bc32995d984d812066cff6603f4345f6b4 Mon Sep 17 00:00:00 2001 From: Qin Jiajia Date: Fri, 2 Feb 2024 09:02:53 +0800 Subject: [PATCH] address comments --- .../wasm/jsep/webgpu/ops/3rd-party/conv_backprop_mm_webgpu.ts | 2 +- js/web/lib/wasm/jsep/webgpu/ops/fuse-utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/web/lib/wasm/jsep/webgpu/ops/3rd-party/conv_backprop_mm_webgpu.ts b/js/web/lib/wasm/jsep/webgpu/ops/3rd-party/conv_backprop_mm_webgpu.ts index 9768ea50e9c66..d18f8586dd071 100644 --- a/js/web/lib/wasm/jsep/webgpu/ops/3rd-party/conv_backprop_mm_webgpu.ts +++ b/js/web/lib/wasm/jsep/webgpu/ops/3rd-party/conv_backprop_mm_webgpu.ts @@ -130,7 +130,7 @@ const conv2dTransposeCommonSnippet = return ${type}(0.0); `; - const applyActivation = getActivationSnippet(attributes, type, 'f32'); + const applyActivation = getActivationSnippet(attributes, type); const userCode = ` fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${type} { ${isChannelsLast ? sampleA : sampleW} diff --git a/js/web/lib/wasm/jsep/webgpu/ops/fuse-utils.ts b/js/web/lib/wasm/jsep/webgpu/ops/fuse-utils.ts index 4ef3bd718019c..6e66abacf3471 100644 --- a/js/web/lib/wasm/jsep/webgpu/ops/fuse-utils.ts +++ b/js/web/lib/wasm/jsep/webgpu/ops/fuse-utils.ts @@ -16,7 +16,7 @@ export interface InternalActivationAttributes { } export const getActivationSnippet = - (attributes: InternalActivationAttributes, valueType: string, baseType: string): string => { + (attributes: InternalActivationAttributes, valueType: string, baseType = 'f32'): string => { switch (attributes.activation) { case 'Relu': return `value = max(value, ${valueType}(0.0));`;