class_docstr: Replace label of specified images.
  
  Parameters
  ----------
  indices : Sequence[int]
      The indices of images to relabel.
  new_label : int
      The new label to assign.
class_docstr_tok: ["Replace","label","of","specified","images",".","Parameters","--","--","--","--","--","indices",":","Sequence","[","int","]","The","indices","of","images","to","relabel",".","new_label",":","int","The","new","label","to","assign","."]
code: def generate_code(self) -> Callable:
      to_change = self.indices
      new_label = self.new_label
      my_range = Compiler.get_iterator()
  
      def replace_label(labels, temp_array, indices):
          for i in my_range(labels.shape[0]):
              sample_ix = indices[i]
              position = np.searchsorted(to_change, sample_ix)
              if (
                  position < len(to_change)
                  and to_change[position] == sample_ix
              ):
                  labels[i] = new_label
          return labels
  
      replace_label.is_parallel = True
      replace_label.with_indices = True
  
      return replace_label
  
file_path: ffcv/ffcv/transforms/replace_label.py
imports: from typing import Tuple
  import numpy
  from dataclasses import replace
  from typing import Callable, Optional, Tuple
  from ..pipeline.allocation_query import AllocationQuery
  from ..pipeline.operation import Operation
  from ..pipeline.state import State
  from ..pipeline.compiler import Compiler
label_desc: Use image node_id 2 for calling the ReplaceLabel obj's underlying member method code with example usage: obj.generate_code() and returns: replace_label, labels