class_docstr: Converts the value of a field into a numpy array.
  
  Parameters
  ----------
  expected_ndim
      Expected number of dimensions. Throws an exception if the number of
      dimensions does not match.
  dtype
      numpy dtype to use.
class_docstr_tok: ["Converts","the","value","of","a","field","into","a","numpy","array",".","Parameters","--","--","--","--","--","expected_ndim","Expected","number","of","dimensions",".","Throws","an","exception","if","the","number","of","dimensions","does","not","match",".","dtype","numpy","dtype","to","use","."]
code: def __init__(
      self, field: str, expected_ndim: int, dtype: Type = np.float32
  ) -> None:
      self.field = field
      self.expected_ndim = expected_ndim
      self.dtype = dtype
  
imports: from typing import Callable, Iterator, List, Optional, Tuple, Type
  import numpy
  from toolz import valmap
  from gluonts.core.component import validated, tensor_to_numpy
  from gluonts.dataset.common import DataEntry
  from gluonts.exceptions import assert_data_error
  from ._base import FlatMapTransformation, MapTransformation, SimpleTransformation
label_desc: Use image node_id 1 to create a new AsNumpyArray object from inherited base classes: SimpleTransformation with example: obj = AsNumpyArray(field, expected_ndim, dtype)