a361f45c09f173f662141ac42d4c6c3b8c304be8,gpytorch/lazy/sum_lazy_tensor.py,SumLazyTensor,__init__,#SumLazyTensor#,14

Before Change


class SumLazyTensor(LazyTensor):
    def __init__(self, *lazy_tensors, **kwargs):
        lazy_tensors = list(lazy_tensors)
        for i, lazy_tensor in enumerate(lazy_tensors):
            try:
                lazy_tensors[i] = lazify(lazy_tensor)
            except TypeError:
                raise TypeError("All arguments of a SumLazyTensor should be LazyTensors or Tensors")
        super(SumLazyTensor, self).__init__(*lazy_tensors, **kwargs)

        self.lazy_tensors = lazy_tensors

After Change


class SumLazyTensor(LazyTensor):
    def __init__(self, *lazy_tensors, **kwargs):
        try:
            lazy_tensors = tuple(lazify(lt) for lt in lazy_tensors)
        except TypeError:
            raise TypeError("All arguments of a SumLazyTensor should be LazyTensors or Tensors")
        batch_shape = _mul_broadcast_shape(*[lt.shape for lt in lazy_tensors])
        lazy_tensors = tuple(lt.expand(batch_shape) for lt in lazy_tensors)
        super(SumLazyTensor, self).__init__(*lazy_tensors, **kwargs)

        self.lazy_tensors = lazy_tensors
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: a361f45c09f173f662141ac42d4c6c3b8c304be8
Time: 2019-11-22
Author: wm326@cornell.edu
File Name: gpytorch/lazy/sum_lazy_tensor.py
Class Name: SumLazyTensor
Method Name: __init__


Project Name: ilastik/ilastik
Commit Name: 558f030de16f0e3ea4ce860aac0d085faad99441
Time: 2019-08-13
Author: k-dominik@users.noreply.github.com
File Name: ilastik/applets/batchProcessing/batchProcessingGui.py
Class Name: BatchProcessingGui
Method Name: run_export


Project Name: has2k1/plotnine
Commit Name: 43ae81ebbe860010aaaa3d739284ebeb8284e59e
Time: 2017-05-07
Author: has2k1@gmail.com
File Name: plotnine/facets/facet.py
Class Name:
Method Name: unique_combs