5809cb0b339612434f4f332a91a2cd3e4570c34d,gpflow/transforms.py,LowerTriangular,backward_tensor,#LowerTriangular#Any#,392

Before Change


        CAVEAT: Requires defined shape and can"t work with unknown shape.
        
        size = np.prod(y.shape.as_list())
        N = int(np.sqrt(size / self.num_matrices))
        reshaped = tf.reshape(y, shape=(self.num_matrices, N, N))
        indices = np.array([np.hstack(x) for x in
                            itertools.product(np.arange(self.num_matrices), np.dstack(np.tril_indices(N))[0])])
        triangular = tf.reshape(tf.gather_nd(reshaped, indices), shape=[-1])
        return triangular

    def log_jacobian_tensor(self, x):
        return tf.zeros((1,), settings.float_type)

After Change


            x tensor with shape self.num_matrices, (self.N**2 + self.N) / 2
        
        if self.squeeze:
            y = tf.expand_dims(y, axis=0)
        indices = np.vstack(np.tril_indices(self.N)).T
        indices = itertools.product(np.arange(self.num_matrices), indices)
        indices = np.array([np.hstack(x) for x in indices])
        triangular = tf.gather_nd(y, indices)
        return tf.reshape(triangular, [self.num_matrices, (self.N**2 + self.N) // 2])

    def log_jacobian_tensor(self, x):
        return tf.zeros((1,), settings.float_type)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: GPflow/GPflow
Commit Name: 5809cb0b339612434f4f332a91a2cd3e4570c34d
Time: 2018-02-26
Author: james@prowler.io
File Name: gpflow/transforms.py
Class Name: LowerTriangular
Method Name: backward_tensor


Project Name: ChrisCummins/clgen
Commit Name: 29bf958785d87f57893f0f07f307d2e35805b8e3
Time: 2018-06-05
Author: chrisc.101@gmail.com
File Name: deeplearning/clgen/models/tensorflow_backend.py
Class Name: TensorFlowModel
Method Name: GetParamsPath


Project Name: osmr/imgclsmob
Commit Name: 4ad1ebea7992d840e028ff513dc81e0073755d6e
Time: 2019-02-24
Author: osemery@gmail.com
File Name: pytorch/pytorchcv/models/others/oth_fractalnet_cifar10_2.py
Class Name: FractalNet
Method Name: forward