Home / Function/ __post_init__() — pytorch Function Reference

__post_init__() — pytorch Function Reference

Architecture documentation for the __post_init__() function in generate_kernels.py from the pytorch codebase.

Entity Profile

Dependency Diagram

graph TD
  09ea15c6_e3f3_3717_43c9_3ba9e722f8e2["__post_init__()"]
  b6356833_87b5_3a29_f757_dbd0dd087434["__post_init__()"]
  b6356833_87b5_3a29_f757_dbd0dd087434 -->|calls| 09ea15c6_e3f3_3717_43c9_3ba9e722f8e2
  b6356833_87b5_3a29_f757_dbd0dd087434["__post_init__()"]
  09ea15c6_e3f3_3717_43c9_3ba9e722f8e2 -->|calls| b6356833_87b5_3a29_f757_dbd0dd087434
  style 09ea15c6_e3f3_3717_43c9_3ba9e722f8e2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

aten/src/ATen/native/transformers/cuda/mem_eff_attention/kernels/generate_kernels.py lines 62–75

    def __post_init__(self) -> None:
        # Set kernel selection priority
        # The lowest value that matches inputs
        # will be selected
        self.sort_index = (
            # First select aligned kernel
            0 if self.aligned else 1,
            # Then keep output in RF
            self.max_k,
            self.k,
            # Prefer kernels without dropout/bias if available
            1 if self.supports_dropout else 0,
            1 if self.supports_bias else 0,
        )

Subdomains

Called By

Frequently Asked Questions

What does __post_init__() do?
__post_init__() is a function in the pytorch codebase.
What does __post_init__() call?
__post_init__() calls 1 function(s): __post_init__.
What calls __post_init__()?
__post_init__() is called by 1 function(s): __post_init__.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free