code: def default_stream(device: torch.device) -> AbstractStream:
      """:func:`torch.cuda.default_stream` for either CPU or CUDA device."""
      if device.type != "cuda":
          return CPUStream
      return torch.cuda.default_stream(device)
  
file_path: fairscale/fairscale/nn/pipe/stream.py
imports: from contextlib import contextmanager
  from typing import Generator, List, Optional, Union, cast
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: default_stream(device) and returns: torch, CPUStream