4a1ec9808c64efb92d645c288c6d79e11a497fc4,gpytorch/variational/_variational_strategy.py,_VariationalStrategy,__call__,#_VariationalStrategy#Any#Any#,104

Before Change



        // Delete previously cached items from the training distribution
        if self.training:
            if hasattr(self, "_memoize_cache"):
                delattr(self, "_memoize_cache")
                self._memoize_cache = dict()
        // (Maybe) initialize variational distribution
        if not self.variational_params_initialized.item():
            prior_dist = self.prior_distribution
            self._variational_distribution.initialize_variational_distribution(prior_dist)
            self.variational_params_initialized.fill_(1)

After Change


            clear_cache_hook(self)
        return super().train(mode=mode)

    def __call__(self, x, prior=False):
        // If we"re in prior mode, then we"re done!
        if prior:
            return self.model.forward(x)

        // Delete previously cached items from the training distribution
        if self.training:
            clear_cache_hook(self)
        // (Maybe) initialize variational distribution
        if not self.variational_params_initialized.item():
            prior_dist = self.prior_distribution
            self._variational_distribution.initialize_variational_distribution(prior_dist)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 4a1ec9808c64efb92d645c288c6d79e11a497fc4
Time: 2020-07-17
Author: balandat@fb.com
File Name: gpytorch/variational/_variational_strategy.py
Class Name: _VariationalStrategy
Method Name: __call__


Project Name: cornellius-gp/gpytorch
Commit Name: 4a1ec9808c64efb92d645c288c6d79e11a497fc4
Time: 2020-07-17
Author: balandat@fb.com
File Name: gpytorch/variational/variational_strategy.py
Class Name: VariationalStrategy
Method Name: __call__


Project Name: cornellius-gp/gpytorch
Commit Name: 4a1ec9808c64efb92d645c288c6d79e11a497fc4
Time: 2020-07-17
Author: balandat@fb.com
File Name: gpytorch/variational/whitened_variational_strategy.py
Class Name: WhitenedVariationalStrategy
Method Name: __call__