-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRAFT FuseInstanceNorm with 3D 1NM shape
fix for FuseInstanceNorm with 3D 1NM shape. Signed-off-by: SaeHie Park <[email protected]>
- Loading branch information
1 parent
39c39a3
commit 78ca308
Showing
5 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
184 changes: 184 additions & 0 deletions
184
res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.recipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
# | ||
# This was copied from Net_InstanceNorm_008 | ||
# with last dim value > 1 | ||
# | ||
|
||
operand { | ||
name: "Hole" | ||
type: FLOAT32 | ||
shape { | ||
dim: 1 dim: 4 dim: 8 | ||
} | ||
} | ||
operand { | ||
name: "InstanceNorm/beta" | ||
type: FLOAT32 | ||
shape { | ||
dim: 1 dim: 4 dim: 1 | ||
} | ||
filler { | ||
tag: "gaussian" | ||
arg: "0.0" | ||
arg: "1.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/beta" | ||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |