class_docstr: Default decoder for :class:`~ffcv.fields.NDArrayField`.
class_docstr_tok: ["Default","decoder","for",":","class",":","`","~ffcv.fields.NDArrayField","`","."]
code: def generate_code(self) -> Callable:
      my_range = Compiler.get_iterator()
      mem_read = self.memory_read
      my_memcpy = Compiler.compile(memcpy)
  
      def decoder(indices, destination, metadata, storage_state):
          for ix in my_range(indices.shape[0]):
              sample_id = indices[ix]
              ptr = metadata[sample_id]
              data = mem_read(ptr, storage_state)
              my_memcpy(data, destination[ix].view(np.uint8))
          return destination
  
      return decoder
  
imports: from typing import Callable, TYPE_CHECKING, Tuple, Type
  import warnings
  import json
  from dataclasses import replace
  import numpy
  import torch
  from .base import Field, ARG_TYPE
  from ..pipeline.operation import Operation
  from ..pipeline.state import State
  from ..pipeline.compiler import Compiler
  from ..pipeline.allocation_query import AllocationQuery
  from ..libffcv import memcpy
label_desc: Use image node_id 2 for calling the NDArrayDecoder obj's underlying member method code with example usage: obj.generate_code() and returns: decoder, destination