From edd9c6453fddb81dc225eea2700a06ed7b9aae77 Mon Sep 17 00:00:00 2001 From: SaeHie Park Date: Mon, 2 Dec 2024 18:02:57 +0900 Subject: [PATCH] [res] Introduce Net_InstanceNorm_009 This will introduce Net_InstanceNorm_009 copied from Net_InstanceNorm_008 with 1x4x8 input shape and random beta. ONE-DCO-1.0-Signed-off-by: SaeHie Park --- .../Net_InstanceNorm_009/test.recipe | 184 ++++++++++++++++++ .../Net_InstanceNorm_009/test.rule | 13 ++ 2 files changed, 197 insertions(+) create mode 100644 res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.recipe create mode 100644 res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.rule diff --git a/res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.recipe b/res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.recipe new file mode 100644 index 00000000000..6af7dcffba1 --- /dev/null +++ b/res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.recipe @@ -0,0 +1,184 @@ +# +# This was copied from Net_InstanceNorm_008 +# with last dim > 1 and beta with random beta +# + +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" diff --git a/res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.rule b/res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.rule new file mode 100644 index 00000000000..e8af35f05c3 --- /dev/null +++ b/res/TensorFlowLiteRecipes/Net_InstanceNorm_009/test.rule @@ -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