mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-02-06 11:11:36 +08:00
24 lines
613 B
Python
24 lines
613 B
Python
# This file is vendored from the Triton project. DO NOT EDIT THIS FILE DIRECTLY.
|
|
# Source: https://github.com/triton-lang/triton/tree/v3.5.1/python/triton_kernels/triton_kernels/tensor_details/layout_details/base.py
|
|
# Triton is licensed under the MIT License.
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
class Layout(ABC):
|
|
|
|
def __init__(self, shape) -> None:
|
|
self.initial_shape = shape
|
|
|
|
@abstractmethod
|
|
def swizzle_data(self, data):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def unswizzle_data(self, data):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def swizzle_block_shape(self, block_shape):
|
|
pass
|