tilelang.tools.plot_layout ========================== .. py:module:: tilelang.tools.plot_layout Functions --------- .. autoapisummary:: tilelang.tools.plot_layout.plot_layout tilelang.tools.plot_layout.plot_fragment_tv Module Contents --------------- .. py:function:: plot_layout(layout, save_directory='./tmp', name = 'layout', colormap = None, verbose = False, formats = 'pdf', view = 'input', grid_shape = None) Plot the layout mapping as a 2D grid visualization. Dispatches to Fragment-specific or Layout-specific plotting based on the type of the layout object. :param layout: The layout object to visualize. :type layout: T.Layout or T.Fragment :param save_directory: Output directory (default "./tmp"). :type save_directory: str, optional :param name: Base filename for saved images (default "layout"). :type name: str, optional :param colormap: Matplotlib colormap name. Defaults to "RdPu" for Fragment, "Spectral" for Layout. :type colormap: str, optional :param verbose: If True, print mapping details. :type verbose: bool, optional :param formats: Output format(s): "pdf", "png", "svg", "all", or comma-separated (default "pdf"). :type formats: str | list[str], optional :param view: For `T.Layout` only: choose which space is shown as the 2D grid. - "input" (default): grid is input space, labels show output (flattened) coordinates. - "output": grid is output space, labels show input coordinates. :type view: str, optional :param grid_shape: For `view="input"` only: override the 2D grid shape (rows, cols). The product must match the total number of input elements. :type grid_shape: tuple[int, int] | None, optional .. py:function:: plot_fragment_tv(frag, save_directory = None, name = 'layout', apply_idx_fn=lambda *args: args, colormap = 'RdPu', item_scale = 0.75, formats = 'pdf', dpi=80) Plot fragment in terms of thread and local index mapping. :param frag: The fragment object that describes how indices are mapped. :type frag: T.Fragment :param save_directory: The directory where the output images will be saved. :type save_directory: str | None, optional :param name: The base name of the output files (default is "layout"). :type name: str, optional :param apply_idx_fn: A function to apply to the source indices for labeling (default is identity). :type apply_idx_fn: function, optional :param colormap: The colormap to use for visualization (default is "RdPu"). :type colormap: str, optional :param item_scale: The scale factor for each item in the plot (default is 0.75). :type item_scale: float, optional :param formats: The formats to save the image in (default is "pdf"). :type formats: str | list[str], optional :param dpi: The resolution in dots per inch for the saved image (default is 80). :type dpi: int, optional