879ae4cfb89595955190493b5787e6f0bf727d1a,tensorflow2/tf2cv/models/common.py,SABlock,call,#SABlock#Any#Any#,2547

Before Change


        w = tf.reshape(w, shape=(batch, self.groups, self.radix, -1))
        w = tf.transpose(w, perm=(0, 2, 1, 3, 4))
        if is_channels_first(self.data_format):
            w = tf.transpose(w, perm=(0, 2, 1, 3, 4))
        else:
            w = tf.transpose(w, perm=(0, 1, 2, 4, 3))
        w = self.softmax(w)
        if is_channels_first(self.data_format):

After Change


            height = x_shape[1]
            width = x_shape[2]
            channels = x_shape[3]
            x = tf.reshape(x, shape=(batch, height, width, self.radix, channels // self.radix))
            w = tf.math.reduce_sum(x, axis=-2)

        w = self.pool(w)
        if self.use_conv:
            axis = -1 if is_channels_first(self.data_format) else 1
            w = tf.expand_dims(tf.expand_dims(w, axis=axis), axis=axis)
        w = self.conv1(w) if self.use_conv else self.fc1(w)
        w = self.bn(w, training=training)
        w = self.activ(w)
        w = self.conv2(w) if self.use_conv else self.fc2(w)
        w = tf.reshape(w, shape=(batch, self.groups, self.radix, -1))
        w = tf.transpose(w, perm=(0, 2, 1, 3))
        w = self.softmax(w)
        if is_channels_first(self.data_format):
            w = tf.reshape(w, shape=(batch, self.radix, -1, 1, 1))
        else:
            w = tf.reshape(w, shape=(batch, 1, 1, self.radix, -1))
        x = x * w
        if is_channels_first(self.data_format):
            x = tf.math.reduce_sum(x, axis=1)
        else:
            x = tf.math.reduce_sum(x, axis=-2)
        return x
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: osmr/imgclsmob
Commit Name: 879ae4cfb89595955190493b5787e6f0bf727d1a
Time: 2020-10-19
Author: osemery@gmail.com
File Name: tensorflow2/tf2cv/models/common.py
Class Name: SABlock
Method Name: call


Project Name: GPflow/GPflow
Commit Name: bd1e9c04b48dd5ccca9619d5eaa2595a358bdb08
Time: 2020-01-31
Author: st--@users.noreply.github.com
File Name: gpflow/kernels/misc.py
Class Name: Coregion
Method Name: K


Project Name: GPflow/GPflow
Commit Name: 57a645b87e8fa84cc7161ea7c83f5e3bca4e529e
Time: 2016-01-19
Author: james.hensman@gmail.com
File Name: GPflow/svgp.py
Class Name: SVGP
Method Name: build_likelihood