Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

implement Resize operator #228

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions docs/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ _This file is automatically generated from the def files via [this script](/tool
| [ReduceSumSquare](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceSumSquare) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSumSquare-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSumSquare-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSumSquare-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSumSquare-11) |
| [Relu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Relu) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Relu-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Relu-6) |
| [Reshape](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Reshape) | [5+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Reshape-5) | | [5+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Reshape-5) |
| [Resize](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Resize) | | | |
| [Resize](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Resize) | [10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Resize-10), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Resize-11) | | [10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Resize-10), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Resize-11) |
| [ReverseSequence](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReverseSequence) | | | |
| [RoiAlign](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RoiAlign) | | | |
| [Round](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Round) | | | |
Expand Down Expand Up @@ -167,6 +167,6 @@ _This file is automatically generated from the def files via [this script](/tool
| [Transpose](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Transpose) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Transpose-1) | | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Transpose-1) |
| [Unique](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Unique) | | | |
| [Unsqueeze](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Unsqueeze) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Unsqueeze-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Unsqueeze-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Unsqueeze-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Unsqueeze-11) |
| [Upsample](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Upsample) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Upsample-7), [9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Upsample-9) | | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Upsample-7) |
| [Upsample](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Upsample) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Upsample-7), [9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Upsample-9) | | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Upsample-7), [9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Upsample-9) |
| [Where](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Where) | | | |
| [Xor](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Xor) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Xor-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Xor-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Xor-7) |
8 changes: 5 additions & 3 deletions lib/backends/cpu/op-resolve-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {CpuTranspose} from './ops/transpose';
import * as unaryOps from './ops/unary-op';
import {CpuUnaryOp} from './ops/unary-op';
import {CpuUnsqueeze} from './ops/unsqueeze';
import {CpuUpsample, CpuUpsampleV9} from './ops/upsample';
import {CpuUpsample} from './ops/upsample';

export const CPU_OP_RESOLVE_RULES: ReadonlyArray<OpSet.ResolveRule> = [
['Abs', '', '6+', () => new CpuUnaryOp(NUMBER_TYPES, unaryOps.abs)],
Expand Down Expand Up @@ -92,6 +92,8 @@ export const CPU_OP_RESOLVE_RULES: ReadonlyArray<OpSet.ResolveRule> = [
['ReduceSumSquare', '', '1+', () => new cpuReduce.CpuReduceSumSquare()],
['Relu', '', '6+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.relu)],
['Reshape', '', '5+', () => new CpuReshape()],
['Resize', '', '10', () => new CpuUpsample(10)],
['Resize', '', '11+', () => new CpuUpsample(11)],
['Shape', '', '1+', () => new CpuShape()],
['Sigmoid', '', '6+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.sigmoid)],
['Sign', '', '9+', () => new CpuUnaryOp(NUMBER_TYPES, unaryOps.sign)],
Expand All @@ -109,7 +111,7 @@ export const CPU_OP_RESOLVE_RULES: ReadonlyArray<OpSet.ResolveRule> = [
['Tile', '', '6+', () => new CpuTile()],
['Transpose', '', '1+', () => new CpuTranspose()],
['Unsqueeze', '', '1+', () => new CpuUnsqueeze()],
['Upsample', '', '7-8', () => new CpuUpsample()],
['Upsample', '', '9', () => new CpuUpsampleV9()],
['Upsample', '', '7-8', () => new CpuUpsample(7)],
['Upsample', '', '9', () => new CpuUpsample(9)],
['Xor', '', '7+', () => new CpuBinaryOp(['bool'], (e1, e2) => (e1 ^ e2))],
];
Loading