class_docstr: Deserializer for NPZ format.
  
  This is the standard deserializer in Chainer. This deserializer can be used
  to read an object serialized by :func:`save_npz`.
  
  Args:
      npz: `npz` file object.
      path: The base path that the deserialization starts from.
      strict (bool): If ``True``, the deserializer raises an error when an
          expected value is not found in the given NPZ file. Otherwise,
          it ignores the value and skip deserialization.
      ignore_names (string, callable or list of them):
          If callable, it is a function that takes a name of a parameter
          and a persistent and returns ``True`` when it needs to be skipped.
          If string, this is a name of a parameter or persistent that are
          going to be skipped.
          This can also be a list of callables and strings that behave as
          described above.
class_docstr_tok: ["Deserializer","for","NPZ","format",".","This","is","the","standard","deserializer","in","Chainer",".","This","deserializer","can","be","used","to","read","an","object","serialized","by",":","func",":","`","save_npz","`",".","Args",":","npz",":","`","npz","`","file","object",".","path",":","The","base","path","that","the","deserialization","starts","from",".","strict","(","bool",")",":","If","``","True","``",",","the","deserializer","raises","an","error","when","an","expected","value","is","not","found","in","the","given","NPZ","file",".","Otherwise",",","it","ignores","the","value","and","skip","deserialization",".","ignore_names","(","string",",","callable","or","list","of","them",")",":","If","callable",",","it","is","a","function","that","takes","a","name","of","a","parameter","and","a","persistent","and","returns","``","True","``","when","it","needs","to","be","skipped",".","If","string",",","this","is","a","name","of","a","parameter","or","persistent","that","are","going","to","be","skipped",".","This","can","also","be","a","list","of","callables","and","strings","that","behave","as","described","above","."]
code: def __call__(self, key, value):
      key = self.path + key.lstrip("/")
      if not self.strict and key not in self.npz:
          return value
  
      if isinstance(self.ignore_names, (tuple, list)):
          ignore_names = self.ignore_names
      else:
          ignore_names = (self.ignore_names,)
      for ignore_name in ignore_names:
          if isinstance(ignore_name, str):
              if key == ignore_name:
                  return value
          elif callable(ignore_name):
              if ignore_name(key):
                  return value
          else:
              raise ValueError(
                  "ignore_names needs to be a callable, string or "
                  "list of them."
              )
  
      dataset = self.npz[key]
      if dataset[()] is None:
          return None
      if value is None:
          return dataset
      if isinstance(value, chainerx.ndarray):
          value[...] = _chainerx._array_to_chainerx(
              numpy.asarray(dataset), value.device
          )
      elif isinstance(value, numpy.ndarray):
          numpy.copyto(value, dataset)
      elif isinstance(value, cuda.ndarray):
          value.set(numpy.asarray(dataset, dtype=value.dtype))
      elif isinstance(value, intel64.mdarray):
          intel64.ideep.basic_copyto(value, numpy.asarray(dataset))
      else:
          value_type = type(value)
          dataset_arr = numpy.asarray(dataset)
          if (
              issubclass(dataset_arr.dtype.type, numpy.number)
              and not (
                  issubclass(dataset_arr.dtype.type, numpy.integer)
                  and value_type in six.integer_types
              )
              # Casting a `numpy.integer` scalar by `int()` case above is
              # safe as `int()` gives unlimited precision integer (it's
              # also true for `long()`/`int()` on Python 2). For such a
              # case, the check below may be too strict. For example,
              # `numpy.can_cast(numpy.int64, int)`, which checks cast-
              # ability to `dtype(int)`, gives `False` on a platform
              # whose `dtype(int)` is `numpy.int32` like Windows/x64.
              and not numpy.can_cast(
                  dataset_arr.dtype, value_type, casting="safe"
              )
          ):
              raise TypeError(
                  "Cannot safely deserialize from numpy array with dtype={} "
                  "into a variable of type {}.".format(
                      dataset.dtype, type(value)
                  )
              )
          value = value_type(dataset_arr)
      return value
  
imports: import numpy
  import six
  from chainer.backends import _chainerx
  from chainer.backends import _cpu
  from chainer.backends import cuda
  from chainer.backends import intel64
  from chainer import serializer
  import chainerx
label_desc: Use image node_id 3 for calling the NpzDeserializer obj's underlying member method code with example usage: obj.__call__(key, value) and returns: value, value, None, dataset, value, value