Skip to content

Commit

Permalink
clip and ceil
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-eire committed Sep 13, 2022
1 parent 55af08e commit dfbf6f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions js/web/lib/onnxjs/backends/webgpu/op-resolve-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
8 changes: 4 additions & 4 deletions js/web/lib/onnxjs/backends/webgpu/ops/unary-op.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dfbf6f3

Please sign in to comment.