def call(self, x):
    if (K.backend() == 'tensorflow'):
        tf = K.tf
        (x, _) = tf.nn.top_k(x, self.k, sorted=False)
        return K.mean(x, axis=(- 1))
    else:
        raise NotImplementedError(('TopKAverage is not implemented for  %s backend' % (K.backend(),)))
def call(self, x):
    if (K.backend() == 'tensorflow'):
        tf = K.tf
        (x, _) = tf.nn.top_k(x, self.k, sorted=False)
        return K.mean(x, axis=(- 1))
    else:
        raise NotImplementedError(('TopKAverage is not implemented for  %s backend' % (K.backend(),)))