parameters: (dali_tensor, arr, cuda_stream = None)
docstring: Copy contents of DALI tensor to MXNet's NDArray.
  
      Parameters
      ----------
      `dali_tensor` : nvidia.dali.backend.TensorCPU or nvidia.dali.backend.TensorGPU
                      Tensor from which to copy
      `arr` : mxnet.nd.NDArray
              Destination of the copy
      `cuda_stream` : cudaStream_t handle or any value that can be cast to cudaStream_t.
                      CUDA stream to be used for the copy
                      (if not provided, an internal user stream will be selected)
                      In most cases, using the default internal user stream or stream 0
                      is expected.
docstring_summary: Copy contents of DALI tensor to MXNet's NDArray.
docstring_tokens: Copy contents of DALI tensor to MXNet s NDArray .
function: def feed_ndarray(dali_tensor, arr, cuda_stream = None):
      """
      Copy contents of DALI tensor to MXNet's NDArray.
  
      Parameters
      ----------
      `dali_tensor` : nvidia.dali.backend.TensorCPU or nvidia.dali.backend.TensorGPU
                      Tensor from which to copy
      `arr` : mxnet.nd.NDArray
              Destination of the copy
      `cuda_stream` : cudaStream_t handle or any value that can be cast to cudaStream_t.
                      CUDA stream to be used for the copy
                      (if not provided, an internal user stream will be selected)
                      In most cases, using the default internal user stream or stream 0
                      is expected.
      """
      dali_type = types.to_numpy_type(dali_tensor.dtype)
  
      assert dali_type == arr.dtype, ("The element type of DALI Tensor/TensorList"
  	        " doesn't match the element type of the target MXNet NDArray: {} vs {}".format(dali_type, np.dtype(arr.dtype)))
  
      # Wait until arr is no longer used by the engine
      _wait_to_write(arr)
      assert dali_tensor.shape() == list(arr.shape), \
              ("Shapes do not match: DALI tensor has shape {0}"
              ", but NDArray has shape {1}".format(dali_tensor.shape(), list(arr.shape)))
      # Get CTypes void pointer to the underlying memory held by arr
      ptr = ctypes.c_void_p()
      mx.base._LIB.MXNDArrayGetData(arr.handle, ctypes.byref(ptr))
  
      cuda_stream = types._raw_cuda_stream(cuda_stream)
  
      # Copy data from DALI tensor to ptr
      if isinstance(dali_tensor, (TensorGPU, TensorListGPU)):
          dali_tensor.copy_to_external(ptr, None if cuda_stream is None else ctypes.c_void_p(cuda_stream))
      else:
          dali_tensor.copy_to_external(ptr)
function_tokens: def feed_ndarray ( dali_tensor , arr , cuda_stream = None ) : dali_type = types . to_numpy_type ( dali_tensor . dtype ) assert dali_type == arr . dtype , ( "The element type of DALI Tensor/TensorList" " doesn't match the element type of the target MXNet NDArray: {} vs {}" . format ( dali_type , np . dtype ( arr . dtype ) ) ) # Wait until arr is no longer used by the engine _wait_to_write ( arr ) assert dali_tensor . shape ( ) == list ( arr . shape ) , ( "Shapes do not match: DALI tensor has shape {0}" ", but NDArray has shape {1}" . format ( dali_tensor . shape ( ) , list ( arr . shape ) ) ) # Get CTypes void pointer to the underlying memory held by arr ptr = ctypes . c_void_p ( ) mx . base . _LIB . MXNDArrayGetData ( arr . handle , ctypes . byref ( ptr ) ) cuda_stream = types . _raw_cuda_stream ( cuda_stream ) # Copy data from DALI tensor to ptr if isinstance ( dali_tensor , ( TensorGPU , TensorListGPU ) ) : dali_tensor . copy_to_external ( ptr , None if cuda_stream is None else ctypes . c_void_p ( cuda_stream ) ) else : dali_tensor . copy_to_external ( ptr )