Reset the batch of environments.

    Args:
      indices: The batch indices of the environments to reset.

    Returns:
      Batch tensor of the new observations.
546260
def reset(self, indices=None):
    
    return tf.cond(
        tf.cast(tf.reduce_sum(indices + 1), tf.bool),
        lambda: self._reset_non_empty(indices),
        lambda: tf.cast(0, self.observ_dtype))
758353
private int[] reIndexIndices(SortableVertex[] sortVertices, int[] indices) {
        // Create temporary lookup-array, O(n)
        int[] indexLUT = new int[sortVertices.length];
        int[] newIndices = new int[indices.length];

        for (int i = 0; i < sortVertices.length; ++i) {
            indexLUT[sortVertices[i].originalIndex] = i;
        }

        // Convert old indices to new indices, O(n)
        for (int i = 0; i < indices.length; ++i) {
            newIndices[i] = indexLUT[indices[i]];
        }


        return newIndices;
    }
1104959
def _get_transitions(self, indexes):
        
        transition_tensors = self.backend.get_transitions(indexes)

        return Trajectories(
            num_steps=indexes.shape[0],
            num_envs=indexes.shape[1],
            environment_information=None,
            transition_tensors=transition_tensors,
            rollout_tensors={}
        ).to_transitions()
301750
def clean_indices
      indices = all_indices(unaliased: true)
      indices.each do |index|
        Searchkick::Index.new(index).delete
      end
      indices
    end
290850
def reset(self):
        
        super(OASISSampler, self).reset()
        self.strata.reset()
        self._BB_model.reset()

        # Array to record history of instrumental distributions
        if self.record_inst_hist:
            self._inst_pmf = np.zeros([self.strata.n_strata_, self._max_iter],
                                      dtype=float)
        else:
            self._inst_pmf = np.zeros(self.strata.n_strata_, dtype=float)
1242713
def reorder_indices(self, indices_order):
        ''
        # allow mixed index syntax like int
        indices_order, single = convert_index_to_keys(self.indices, indices_order)
        old_indices = force_list(self.indices.keys())

        if indices_order == old_indices: # no changes
            return

        if set(old_indices) != set(indices_order):
            raise KeyError('Keys in the new order do not match existing keys')

#        if len(old_indices) == 0: # already return since indices_order must equal to old_indices
#            return

        # must have more than 1 index to reorder
        new_idx = [old_indices.index(i) for i in indices_order]
        # reorder items
        items = [map(i.__getitem__, new_idx) for i in self.items()]
        self.clear(True)
        _MI_init(self, items, indices_order)
518824
def reset(self, entries_to_reset):
    
    num_updates = tf.size(entries_to_reset)
    update_vals = tf.scatter_update(
        self.mem_vals, entries_to_reset,
        tf.tile(tf.expand_dims(
            tf.fill([self.memory_size, self.val_depth], .0), 0),
                [num_updates, 1, 1]))
    update_logits = tf.scatter_update(
        self.mean_logits, entries_to_reset,
        tf.tile(tf.expand_dims(
            tf.fill([self.memory_size], .0), 0),
                [num_updates, 1]))
    reset_op = tf.group([update_vals, update_logits])
    return reset_op
81938
def reshuffle_batches(self, indices, rng):
        
        indices = indices.view(-1, self.global_batch_size)
        num_batches = indices.shape[0]
        order = torch.randperm(num_batches, generator=rng)
        indices = indices[order, :]
        indices = indices.view(-1)
        return indices
1204441
def reset(self):
        '''
        
        '''
        self.parameters = []
        self.transformed_parameters = []
        self.expressions = []
        self.data = []
        self.transformed_data = []
        self.X = {}
        self.model = []
        self.mu_cont = []
        self.mu_cat = []
        self._original_names = {}
        # variables to suppress in output. Stan uses limited set for variable
        # names, so track variable names we may need to simplify for the model
        # code and then sub back later.
        self._suppress_vars = ['yhat', 'lp__']
1361518
public void resetIndex(long index, long timestamp) {
    currentOperation = OperationType.COMMAND;
    operationIndex = index;
    currentIndex = index;
    currentTimestamp = timestamp;
    setCommitIndex(index);
    service.tick(new WallClockTimestamp(currentTimestamp));
  }
66993
def reset(self):
        """"""
        self.data     = []
        self.size     = 0
        self.kdtree   = None  # KDTree
        self.nn_ready = False
870854
def reset(self):
        
        logger.debug("{}'s Monitor being reset".format(self))
        instances_ids = self.instances.started.keys()
        self.numOrderedRequests = {inst_id: (0, 0) for inst_id in instances_ids}
        self.requestTracker.reset()
        self.masterReqLatencies = {}
        self.masterReqLatencyTooHigh = False
        self.totalViewChanges += 1
        self.lastKnownTraffic = self.calculateTraffic()
        if self.acc_monitor:
            self.acc_monitor.reset()
        for i in instances_ids:
            rm = self.create_throughput_measurement(self.config)
            self.throughputs[i] = rm
            lm = self.latency_measurement_cls(self.config)
            self.clientAvgReqLatencies[i] = lm
1111189
def reset(self):
        """"""
        import tqdm
        self.iter = 0
        self.pbar = tqdm.tqdm(total=self.niter, **self.kwargs)
342722
def shuffled_batches(self, batch_size):
        
        if batch_size >= self.size:
            yield self
        else:
            batch_splits = math_util.divide_ceiling(self.size, batch_size)
            indices = list(range(self.size))
            np.random.shuffle(indices)

            for sub_indices in np.array_split(indices, batch_splits):
                yield Transitions(
                    size=len(sub_indices),
                    environment_information=None,
                    # Dont use it in batches for a moment, can be uncommented later if needed
                    # environment_information=[info[sub_indices.tolist()] for info in self.environment_information]
                    transition_tensors={k: v[sub_indices] for k, v in self.transition_tensors.items()}
                    # extra_data does not go into batches
                )
1108394
def reset(self):
        
        super(DruckSampler, self).reset()
        self.strata.reset()
        self._TP_st = np.zeros([self.strata.n_strata_, self._n_class])
        self._PP_st = np.zeros([self.strata.n_strata_, self._n_class])
        self._P_st = np.zeros([self.strata.n_strata_, self._n_class])
        self._TP_rates = np.zeros([self.strata.n_strata_, self._n_class])
        self._PP_rates = np.zeros([self.strata.n_strata_, self._n_class])
        self._P_rates = np.zeros([self.strata.n_strata_, self._n_class])

        for k in self.strata.indices_:
            for i in range(2):
                self._iterate(fixed_stratum = k, calc_rates = False)
736644
def reset(self):
        
        self._undo_stack.clear()
        self._spike_clusters = self._spike_clusters_base
        self._new_cluster_id = self._new_cluster_id_0
74173
def reindex(self, new_index_name: str, identifier_key: str, **kwargs) -> 'ElasticIndex':
        
        if 'url' not in kwargs:
            kwargs['url'] = self.url
        if 'doc_type' not in kwargs:
            kwargs['doc_type'] = self.doc_type
        if 'mapping' not in kwargs:
            kwargs['mapping'] = self.mapping
        new_index = ElasticIndex(new_index_name, **kwargs)

        for results in self.scroll(size=500):
            new_index.bulk(results, identifier_key)
        return new_index