class_docstr: Context-manager that selects a given stream.
  
  N.B. This class only exists to facilitate device-agnostic code
class_docstr_tok: ["Context-manager","that","selects","a","given","stream",".","N.B",".","This","class","only","exists","to","facilitate","device-agnostic","code"]
code: def __init__(self, stream):
      self.stream = stream
      self.prev_stream = _default_cpu_stream
  
imports: from contextlib import AbstractContextManager
  from typing import Any, Optional, Union
  import torch
  from ..None import device
  from .None import amp
label_desc: Use image node_id 1 to create a new StreamContext object from inherited base classes: AbstractContextManager with example: obj = StreamContext(stream)