Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[res] Introduce Net_InstanceNorm_009 #14394

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 183 additions & 0 deletions res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
#
# This was copied from Net_InstanceNorm_008
# with last dim > 1
#

operand {
name: "Hole"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 8
}
}
operand {
name: "InstanceNorm/reshape"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 1
}
filler {
tag: "constant"
arg: "0"
}
}
operand {
name: "InstanceNorm/instancenorm/add/y"
type: FLOAT32
shape {
}
filler {
tag: "explicit"
arg: "1e-06"
}
}
operand {
name: "InstanceNorm/moments/variance/reduction_indices"
type: INT32
shape {
dim: 1
}
filler {
tag: "explicit"
arg: "2"
}
}
operand {
name: "InstanceNorm/moments/mean"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 1
}
}
operand {
name: "InstanceNorm/moments/SquaredDifference"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 8
}
}
operand {
name: "InstanceNorm/moments/variance"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 1
}
}
operand {
name: "InstanceNorm/instancenorm/add"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 8
}
}
operand {
name: "InstanceNorm/instancenorm/Rsqrt"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 1
}
}
operand {
name: "InstanceNorm/instancenorm/mul_1"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 1
}
}
operand {
name: "InstanceNorm/instancenorm/mul_2"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 8
}
}
operand {
name: "InstanceNorm/instancenorm/sub"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 1
}
}
operand {
name: "InstanceNorm/instancenorm/add_1"
type: FLOAT32
shape {
dim: 1 dim: 4 dim: 8
}
}
operation {
type: "Mean"
input: "Hole"
input: "InstanceNorm/moments/variance/reduction_indices"
output: "InstanceNorm/moments/mean"
mean_options {
keep_dims: true
}
}
operation {
type: "SquaredDifference"
input: "Hole"
input: "InstanceNorm/moments/mean"
output: "InstanceNorm/moments/SquaredDifference"
}
operation {
type: "Mean"
input: "InstanceNorm/moments/SquaredDifference"
input: "InstanceNorm/moments/variance/reduction_indices"
output: "InstanceNorm/moments/variance"
mean_options {
keep_dims: true
}
}
operation {
type: "Add"
input: "InstanceNorm/moments/variance"
input: "InstanceNorm/instancenorm/add/y"
output: "InstanceNorm/instancenorm/add"
add_options {
activation: NONE
}
}
operation {
type: "Rsqrt"
input: "InstanceNorm/instancenorm/add"
output: "InstanceNorm/instancenorm/Rsqrt"
}
operation {
type: "Mul"
input: "Hole"
input: "InstanceNorm/instancenorm/Rsqrt"
output: "InstanceNorm/instancenorm/mul_1"
mul_options {
activation: NONE
}
}
operation {
type: "Mul"
input: "InstanceNorm/moments/mean"
input: "InstanceNorm/instancenorm/Rsqrt"
output: "InstanceNorm/instancenorm/mul_2"
mul_options {
activation: NONE
}
}
operation {
type: "Sub"
input: "InstanceNorm/reshape"
input: "InstanceNorm/instancenorm/mul_2"
output: "InstanceNorm/instancenorm/sub"
sub_options {
activation: NONE
}
}
operation {
type: "Add"
input: "InstanceNorm/instancenorm/mul_1"
input: "InstanceNorm/instancenorm/sub"
output: "InstanceNorm/instancenorm/add_1"
add_options {
activation: NONE
}
}
input: "Hole"
output: "InstanceNorm/instancenorm/add_1"
13 changes: 13 additions & 0 deletions res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To check if this network is converted to circle InstanceNorm op

RULE "VERIFY_FILE_FORMAT" $(verify_file_format) '=' 1

RULE "INSTANCE_NORM_EXIST" $(op_count INSTANCE_NORM) '=' 1
RULE "NO_ADD" $(op_count ADD) '=' 0
RULE "NO_MUL" $(op_count MUL) '=' 0
RULE "NO_POW" $(op_count POW) '=' 0
RULE "NO_DIV" $(op_count DIV) '=' 0
RULE "NO_SQUARED_DIFF" $(op_count SQUARED_DIFFERENCE) '=' 0
RULE "NO_MEAN" $(op_count MEAN) '=' 0
RULE "NO_RSQRT" $(op_count RSQRT) '=' 0
RULE "NO_SUB" $(op_count SUB) '=' 0