From dfbf6f36b11e542b86f689400d82fd3dbbc6ee27 Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:11:31 -0700 Subject: [PATCH] clip and ceil --- js/web/lib/onnxjs/backends/webgpu/op-resolve-rules.ts | 6 +++--- js/web/lib/onnxjs/backends/webgpu/ops/unary-op.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/web/lib/onnxjs/backends/webgpu/op-resolve-rules.ts b/js/web/lib/onnxjs/backends/webgpu/op-resolve-rules.ts index c7390764456dc..432fa4c7eeb00 100644 --- a/js/web/lib/onnxjs/backends/webgpu/op-resolve-rules.ts +++ b/js/web/lib/onnxjs/backends/webgpu/op-resolve-rules.ts @@ -14,11 +14,11 @@ export const WEBGPU_OP_RESOLVE_RULES: readonly OpSet.ResolveRule[] = [ // ['AveragePool', '', '7+', averagePool, parseAveragePoolAttributes], // ['BatchNormalization', '', '7+', batchNormalization, parseBatchNormalizationAttributes], // ['Cast', '', '6+', cast, parseCastAttributes], - // ['Ceil', '', '6+', unaryOps.ceil], - ['Clip', '', '6-10', unaryOps.clip, unaryOps.parseClipAttributes], ['Clip', '', '11+', unaryOps.clipV11], + ['Ceil', '', '6+', unaryOps.ceil], ['Clip', '', '6-10', unaryOps.clip, unaryOps.parseClipAttributes], + ['Clip', '', '11+', unaryOps.clipV11], // ['Concat', '', '4+', concat, parseConcatAttributes], // ['Conv', '', '1+', conv, parseConvAttributes], - // ['Cos', '', '7+', unaryOps.cos], + ['Cos', '', '7+', unaryOps.cos], // ['Div', '', '7+', binaryOps.div], // ['Dropout', '', '7+', unaryOps.identity], // ['DepthToSpace', '', '1+', depthToSpace, parseDepthToSpaceAttributes], diff --git a/js/web/lib/onnxjs/backends/webgpu/ops/unary-op.ts b/js/web/lib/onnxjs/backends/webgpu/ops/unary-op.ts index 970b68e7ff93a..bec6477b57532 100644 --- a/js/web/lib/onnxjs/backends/webgpu/ops/unary-op.ts +++ b/js/web/lib/onnxjs/backends/webgpu/ops/unary-op.ts @@ -107,11 +107,11 @@ export const clipV11 = (handler: WebGpuInferenceHandler, inputs: Tensor[]): Tens return clip(handler, [inputs[0]], attributes); }; -// export const ceil = (handler: WebGLInferenceHandler, inputs: Tensor[]): -// Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslCeil()), inputs)]; +export const ceil = (handler: WebGpuInferenceHandler, inputs: Tensor[]): Tensor[] => + handler.run(createElementwiseProgramInfoLoader(inputs[0], 'ceil'), inputs); -// export const cos = (handler: WebGLInferenceHandler, inputs: Tensor[]): -// Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslCos()), inputs)]; +export const cos = (handler: WebGpuInferenceHandler, inputs: Tensor[]): Tensor[] => + handler.run(createElementwiseProgramInfoLoader(inputs[0], 'cos'), inputs); // export interface EluAttributes extends AttributeWithCacheKey { // readonly alpha: number;