d71bc3c8b533c319e49cf6b347d13c48c925ea93,gpytorch/utils/getitem.py,,_compute_getitem_size,#Any#Any#,10

Before Change


    // If we don"t have a continuous set of tensor indices, then the tensor indexed part
    // goes to the front
    if not continuous_tensor_index:
        del final_shape[first_tensor_idx]
        final_shape.insert(0, tensor_idx_shape)

    return torch.Size(final_shape)

After Change


            // goes to the front
            else:
                try:
                    tensor_idx_shape = _mul_broadcast_shape(tensor_idx_shape, idx.shape)
                except RuntimeError:
                    raise IndexError("Incompatible tensor indices in index - got shapes of {} .".format(
                        [idx.shape for idx in indices if torch.is_tensor(idx)]
                    ))

                if slice_after_tensor_idx:
                    tensor_idx = 0

    // If we don"t have a continuous set of tensor indices, then the tensor indexed part
    // goes to the front
    if tensor_idx is not None:
        final_shape = final_shape[:tensor_idx] + list(tensor_idx_shape) + final_shape[tensor_idx:]

    return torch.Size(final_shape)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: d71bc3c8b533c319e49cf6b347d13c48c925ea93
Time: 2019-03-18
Author: gpleiss@gmail.com
File Name: gpytorch/utils/getitem.py
Class Name:
Method Name: _compute_getitem_size


Project Name: cornellius-gp/gpytorch
Commit Name: aa88bfddd883508af23988184c2c528f4a904447
Time: 2020-03-29
Author: balandat@fb.com
File Name: gpytorch/kernels/index_kernel.py
Class Name: IndexKernel
Method Name: forward


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__