tilelang.autotuner.capture ========================== .. py:module:: tilelang.autotuner.capture Classes ------- .. autoapisummary:: tilelang.autotuner.capture.CaptureStack tilelang.autotuner.capture.AutotuneInputsCapture Functions --------- .. autoapisummary:: tilelang.autotuner.capture.set_autotune_inputs tilelang.autotuner.capture.get_autotune_inputs Module Contents --------------- .. py:class:: CaptureStack A simple stack implementation for capturing items in a thread-local context. Used to manage a stack of items (e.g., input tensors) for auto-tuning capture. .. py:attribute:: stack :value: [] .. py:method:: push(item) Push an item onto the top of the stack. :param item: The item to be pushed onto the stack. .. py:method:: pop() Pop and return the top item from the stack. :returns: The item at the top of the stack. :raises IndexError: If the stack is empty. .. py:method:: top() Return the item at the top of the stack without removing it. :returns: The item at the top of the stack. :raises IndexError: If the stack is empty. .. py:method:: size() Return the number of items in the stack. :returns: The size of the stack. :rtype: int .. py:method:: __len__() Return the number of items in the stack (len operator support). :returns: The size of the stack. :rtype: int .. py:method:: __bool__() Return True if the stack is not empty, False otherwise. :returns: Whether the stack contains any items. :rtype: bool .. py:class:: AutotuneInputsCapture(tensors) .. py:attribute:: __slots__ :value: 'tensors' .. py:attribute:: tensors .. py:method:: __enter__() .. py:method:: __exit__(exc_type, exc_val, exc_tb) .. py:function:: set_autotune_inputs(*args) Set input tensors for auto-tuning. This function creates a context manager for capturing input tensors during the auto-tuning process. It supports both: set_autotune_inputs(a, b, c) set_autotune_inputs([a, b, c]) :param \*args: Either a single list/tuple of tensors, or multiple tensor arguments. :returns: A context manager for auto-tuning inputs. :rtype: AutotuneInputsCapture .. py:function:: get_autotune_inputs() Get the current autotune inputs from the stack.