class_docstr: History methods specific to PyTorch
code: def _remove_infs_nans(self, tensor: "torch.Tensor") -> "torch.Tensor":
      if not torch.isfinite(tensor).all():
          tensor = tensor[torch.isfinite(tensor)]
  
      return tensor
  
imports: import itertools
  from functools import reduce
  from operator import mul
  from typing import List
  import wandb
  from wandb import util
  from wandb.data_types import Node
label_desc: Use image node_id 10 for calling the TorchHistory obj's underlying member method code with example usage: obj._remove_infs_nans(tensor) and returns: tensor