(self, dep, ret='tensor')
update cached parent histograms
update cached parent histograms
update cached parent histograms
def _update_cached_histograms(self, dep, ret='tensor'):

        """
        update cached parent histograms
        """

        if dep != self._cur_dep and ret == 'tensor':
            del self._prev_layer_cached_histograms  # delete previous cached histograms
            self._prev_layer_cached_histograms = self._cur_layer_cached_histograms  # update cached histograms
            self._cur_layer_cached_histograms = {}  # for caching new histograms
            self._cur_dep = dep

        elif dep != self._cur_dep and ret == 'tb':
            del self._prev_layer_dtable
            self._prev_layer_dtable = self._cur_layer_dtables[0]
            for table in self._cur_layer_dtables[1:]:
                self._prev_layer_dtable = self._prev_layer_dtable.union(table)
            self._cur_layer_dtables = []
            self._cur_dep = dep

        LOGGER.info('hist subtraction dep is updated to {}'.format(self._cur_dep))
def _update_cached_histograms ( self , dep , ret = 'tensor' ) : if dep != self . _cur_dep and ret == 'tensor' : del self . _prev_layer_cached_histograms # delete previous cached histograms self . _prev_layer_cached_histograms = self . _cur_layer_cached_histograms # update cached histograms self . _cur_layer_cached_histograms = { } # for caching new histograms self . _cur_dep = dep elif dep != self . _cur_dep and ret == 'tb' : del self . _prev_layer_dtable self . _prev_layer_dtable = self . _cur_layer_dtables [ 0 ] for table in self . _cur_layer_dtables [ 1 : ] : self . _prev_layer_dtable = self . _prev_layer_dtable . union ( table ) self . _cur_layer_dtables = [ ] self . _cur_dep = dep LOGGER . info ( 'hist subtraction dep is updated to {}' . format ( self . _cur_dep ) )