"...git@developer.sourcefind.cn:OpenDAS/tilelang.git" did not exist on "58c6b912ac6f18fe15af2b34c190a97bf833ebfd"
Unverified Commit 3ffd1052 authored by Duong Nhu's avatar Duong Nhu Committed by GitHub
Browse files

Udpated concat axis to match image_data_format in keras (#2946)

parent 58873c46
...@@ -66,7 +66,12 @@ class Mutator(BaseMutator): ...@@ -66,7 +66,12 @@ class Mutator(BaseMutator):
if reduction_type == 'mean': if reduction_type == 'mean':
return sum(tensor_list) / len(tensor_list) return sum(tensor_list) / len(tensor_list)
if reduction_type == 'concat': if reduction_type == 'concat':
return tf.concat(tensor_list, axis=0) image_data_format = tf.keras.backend.image_data_format()
if image_data_format == "channels_first":
axis = 0
else:
axis = -1
return tf.concat(tensor_list, axis=axis)
raise ValueError('Unrecognized reduction policy: "{}'.format(reduction_type)) raise ValueError('Unrecognized reduction policy: "{}'.format(reduction_type))
def _get_decision(self, mutable): def _get_decision(self, mutable):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment