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 __enter__(self):
      cur_stream = self.stream
      if cur_stream is None:
          return
  
      global _current_stream
      self.prev_stream = _current_stream
      _current_stream = cur_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 2 for calling the StreamContext obj's underlying member method code with example usage: obj.__enter__() without return types