91b0d220c8e816766fd4565e1d2f5115d3afbefe,gpytorch/lazy/lazy_tensor.py,LazyTensor,matmul,#LazyTensor#Any#,630

Before Change



        // Work out batch dimension, if necessary
        lazy_tsr = self
        if lazy_tsr.ndimension() == 3 and tensor.ndimension() == 3:
            if lazy_tsr.size(0) == 1 and tensor.size(0) > 1:
                lazy_tsr = lazy_tsr.repeat(tensor.size(0), 1, 1)
            elif tensor.size(0) == 1:
                tensor = tensor.expand(lazy_tsr.size(0), tensor.size(1), tensor.size(2))
        elif self.ndimension() > 3 or tensor.ndimension() > 3:
            raise RuntimeError

        func = Matmul(self.representation_tree())
        return func(tensor, *self.representation())

    @property

After Change


                "LazyTensor (size={}) and right-hand-side Tensor (size={}) should have the same number "
                "of dimensions.".format(self.shape, tensor.shape)
            )
        elif self.batch_shape != tensor.shape[:-2] or self.shape[-1] != tensor.shape[-2]:
            raise RuntimeError(
                "LazyTensor (size={}) cannot be multiplied with right-hand-side Tensor (size={}).".format(
                    self.shape, tensor.shape
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 91b0d220c8e816766fd4565e1d2f5115d3afbefe
Time: 2018-10-12
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/lazy_tensor.py
Class Name: LazyTensor
Method Name: matmul


Project Name: pantsbuild/pants
Commit Name: 82f91dd1e53403044d1f6975dfd7dfff32c1d57a
Time: 2015-09-10
Author: john.sirois@gmail.com
File Name: src/python/pants/option/parser.py
Class Name: Parser
Method Name: _compute_default


Project Name: cornellius-gp/gpytorch
Commit Name: c4b2d405f87cb13678222124d35dc3e55a04612e
Time: 2019-07-16
Author: jake.gardner@uber.com
File Name: gpytorch/models/deep_gps/deep_gp.py
Class Name: AbstractDeepGPHiddenLayer
Method Name: __call__