class_docstr: Backward of :func:`~chainer.functions.as_strided`.
      
class_docstr_tok: ["Backward","of",":","func",":","`","~chainer.functions.as_strided","`","."]
code: def forward(self, grads):
      assert len(grads) > 0
      gy = grads[0]
  
      if gy.dtype not in np.sctypes["float"]:
          raise TypeError(
              "Only float is supported for back propagation"
          )
  
      xp = backend.get_array_module(gy)
      input_geometry = self.input_geometry
      itemsize = input_geometry.itemsize
  
      if 0 in input_geometry.shape:
          return xp.zeros(input_geometry.shape)
  
      #  1. remove redundant axis from input/output
      #  [redundant axis]
      #  axis with shape==0, shape==1 or strides==0
      if 0 in gy.shape:
          return backend.get_array_module(gy).zeros(
              input_geometry.shape
          )
      else:
          out_shape = tuple(
              [
                  self.shape[i]
                  for i in six.moves.range(gy.ndim)
                  if self.shape[i] != 1 and self.strides[i] != 0
              ]
          )
          out_strides = tuple(
              [
                  self.strides[i]
                  for i in six.moves.range(gy.ndim)
                  if self.shape[i] != 1 and self.strides[i] != 0
              ]
          )
          gy = gy.sum(
              tuple(
                  [
                      i
                      for i in six.moves.range(gy.ndim)
                      if self.strides[i] == 0
                  ]
              )
          )
          gy = gy.squeeze()
  
      out_storage_offset = self.storage_offset
  
      inp_shape = tuple(
          [
              input_geometry.shape[i]
              for i in six.moves.range(input_geometry.ndim)
              if input_geometry.shape[i] != 1
          ]
      )
      inp_strides = tuple(
          [
              input_geometry.strides[i]
              for i in six.moves.range(input_geometry.ndim)
              if input_geometry.shape[i] != 1
          ]
      )
      inp_storage_offset = input_geometry.storage_offset
  
      #  2. calculate minimum required storage for gradient computation
      inp_min_ptr = _min_index(
          inp_shape, inp_strides, input_geometry.storage_offset
      )
      out_min_ptr = _min_index(
          out_shape, out_strides, self.storage_offset
      )
      common_min_ptr = min(inp_min_ptr, out_min_ptr)
  
      inp_max_ptr = _max_index(
          inp_shape, inp_strides, input_geometry.storage_offset
      )
      out_max_ptr = _max_index(
          out_shape, out_strides, self.storage_offset
      )
      common_max_ptr = max(inp_max_ptr, out_max_ptr)
  
      base_size = (common_max_ptr - common_min_ptr) + 1
  
      storage = xp.zeros(base_size, dtype=gy.dtype)
      flatten_full_indices = xp.arange(
          base_size, dtype=index_dtype[itemsize]
      )
  
      out_maybe_overlap = _maybe_overlapping_memory(
          out_shape, out_strides
      )
  
      if out_maybe_overlap:
          out_indices = _stride_array(
              flatten_full_indices,
              out_shape,
              out_strides,
              out_storage_offset - common_min_ptr,
          )
          _index_add(storage, out_indices, gy)
      else:
          storage_view = _stride_array(
              storage,
              out_shape,
              out_strides,
              out_storage_offset - common_min_ptr,
          )
          storage_view[:] = gy[:]
  
      inp_maybe_overlap = _maybe_overlapping_memory(
          inp_shape, inp_strides
      )
      if inp_maybe_overlap:
          count = xp.zeros_like(storage)
          inp_indices = _stride_array(
              flatten_full_indices,
              inp_shape,
              inp_strides,
              inp_storage_offset - common_min_ptr,
          )
          _index_add(count, inp_indices, xp.ones(1))
          with np.errstate(divide="ignore", invalid="ignore"):
              storage /= count
  
      return (
          _stride_array(
              storage,
              inp_shape,
              inp_strides,
              inp_storage_offset - common_min_ptr,
          ),
      )
  
imports: import numpy
  import six
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling the AsStridedGrad obj's underlying member method code with example usage: obj.forward(grads) and returns: _stride_array, xp, backend