code: def apply_to_tensors(
      fn: Callable,
      container: Union[torch.Tensor, Dict, List, Tuple, Set],
  ) -> Any:
      """Recursively apply to all tensor in different kinds of container types."""
      return apply_to_type(torch.is_tensor, fn, container)
  
file_path: fairscale/fairscale/internal/containers.py
imports: from collections import OrderedDict
  from typing import Any, Callable, Dict, List, NamedTuple, Optional, Set, Tuple, Union, cast
  import numpy
  import torch
  from torch.nn.utils.rnn import PackedSequence
label_desc: Use image node_id 2 for calling a global function with example usage: apply_to_tensors(fn, container) and returns: apply_to_type