docstr: Maps a `pytorch` tensor to `np.ndarray`.
docstr_tok: ["Maps","a","`","pytorch","`","tensor","to","`","np.ndarray","`","."]
code: def to_numpy(X: torch.Tensor) -> np.ndarray:
      """Maps a `pytorch` tensor to `np.ndarray`."""
      return X.detach().cpu().numpy()
  
file_path: alibi/alibi/explainers/similarity/backends/pytorch/base.py
imports: from typing import Any, Callable, List, Optional, Union
  import numpy
  import torch
  import torch.nn
label_desc: Use image node_id 5 for calling the _PytorchBackend obj's underlying member method code with example usage: obj.to_numpy(X) and returns: X