[TF Hub][TF FE] Fix 5D case for FusedBatchNorm (#19904)

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
This commit is contained in:
Roman Kazantsev authored and GitHub committed 2023-09-18 12:51:33 +00:00
1 parent df19699e3a
commit d90ceb93d1
3 files changed
+8 -2

No files matched your search

@@ -35,7 +35,7 @@ class TestFusedBatchNorm(CommonTFLayerTest):
# Create the graph and model
with tf.compat.v1.Session() as sess:
c_dim = x_shape[-1]
if data_format == "NCHW":
if data_format == "NCHW" or data_format == "NCDHW":
c_dim = x_shape[1]
x = tf.compat.v1.placeholder(tf.float32, x_shape, 'x')
if empty_mean_variance:
@@ -92,6 +92,11 @@ class TestFusedBatchNorm(CommonTFLayerTest):
fbn_version="v3"),
dict(x_shape=[5, 10, 8, 2], epsilon=0.0002, exponential_avg_factor=0.2, data_format="NHWC",
is_training=True, fbn_version="v3", empty_mean_variance=False),
# 5D cases
dict(x_shape=[5, 4, 3, 2, 3], epsilon=0.0005, exponential_avg_factor=0.0, data_format="NCDHW",
is_training=False, fbn_version="v3"),
dict(x_shape=[3, 4, 3, 3, 2], epsilon=0.0003, exponential_avg_factor=0.0, data_format="NDHWC",
is_training=False, fbn_version="v3"),
]
@pytest.mark.parametrize("params", test_data_basic)