How to avoid iteration custom keras layer


How would I write something in tensorFlow that would have the same result as

cnt = [tf.reduce_max(tf.divide(outs[i], self.b[1:, i])) for i in range(self.filters)]

This must be able to run on Graph execution, and I just need to increase the effeciency of this line.


I found that tf.reduce_max(tf.divide(outs, self.b[1:]), axis=1) works as intended.

Answered By – MaxPC08

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published