diff --git a/js/web/lib/wasm/jsep/webgpu/ops/grid-sample.ts b/js/web/lib/wasm/jsep/webgpu/ops/grid-sample.ts index 50c71472434ad..16c3af871b4e6 100644 --- a/js/web/lib/wasm/jsep/webgpu/ops/grid-sample.ts +++ b/js/web/lib/wasm/jsep/webgpu/ops/grid-sample.ts @@ -126,6 +126,8 @@ const pixelAtGrid = (input: IndicesHelper, dataType: string, attributes: GridSam if (r >= 0 && r < H && c >=0 && c < W) { indices[${idxH}] = u32(r); indices[${idxW}] = u32(c); + } else { + return ${dataType}(0); } `; case 'border':