# torch 2.15.0 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input
Wrapper around a CUDA green context.

    .. warning::
       This API is in beta and may change in future releases.

    CUDA work should be placed on streams created from the green context:

    .. code-block:: python

        ctx = GreenContext(...)
        stream = ctx.Stream()
        with torch.cuda.stream(stream):
            # torch operations here are using resources from `ctx`
            pass

    Green-context streams are custom CUDA streams. Synchronization with other
    streams is the user's responsibility and should be handled with CUDA events,
    as with any other custom stream.
    
=== parse google
short_description: 'Wrapper around a CUDA green context.'
long_description: |
  .. warning::
     This API is in beta and may change in future releases.
  
  CUDA work should be placed on streams created from the green context:
  
  .. code-block:: python
  
      ctx = GreenContext(...)
      stream = ctx.Stream()
      with torch.cuda.stream(stream):
          # torch operations here are using resources from `ctx`
          pass
  
  Green-context streams are custom CUDA streams. Synchronization with other
  streams is the user's responsibility and should be handled with CUDA events,
  as with any other custom stream.
blank_after_short_description: True
blank_after_long_description: False
style: google
=== detect
rest
=== compose google
Wrapper around a CUDA green context.

.. warning::
   This API is in beta and may change in future releases.

CUDA work should be placed on streams created from the green context:

.. code-block:: python

    ctx = GreenContext(...)
    stream = ctx.Stream()
    with torch.cuda.stream(stream):
        # torch operations here are using resources from `ctx`
        pass

Green-context streams are custom CUDA streams. Synchronization with other
streams is the user's responsibility and should be handled with CUDA events,
as with any other custom stream.
