INNER CODE UNIT · Python

SubstituteTemplate

sangmichaelxie/doremi · flash-attention/csrc/cutlass/tools/library/scripts/pycutlass/src/pycutlass/__init__.py:4

def SubstituteTemplate(template, values):
    text = template
    changed = True
    while changed:
        changed = False
        for key, value in values.items():
            regex = "\\$\\{%s\\}" % key
            newtext = re.sub(regex, value, text)
            if newtext != text:
                changed = True
            text = newtext
    return text

from pycutlass.type_hint import *
from pycutlass.tensor_ref import *
from pycutlass.operation import *
from pycutlass.epilogue import *
from pycutlass.parser import *

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…