from __future__ import annotations

from typing import List, Optional, Sequence, Tuple


class LinearLayout:
    def __init__(self) -> None: ...

    @staticmethod
    def identity_1d(size: int, inDim: str, outDim: str) -> LinearLayout: ...

    @staticmethod
    def strided_1d(
        size: int, stride: int, inDim: str, outDim: str
    ) -> LinearLayout: ...

    @staticmethod
    def zeros_1d(
        size: int, inDim: str, outDim: str, outDimSize: int
    ) -> LinearLayout: ...

    @staticmethod
    def from_bases(
        bases: Sequence[Tuple[str, Sequence[Sequence[int]]]],
        out_dim_names: Sequence[str],
        out_dim_sizes: Optional[Sequence[int]] = ...,
        require_surjective: bool = ...,
    ) -> LinearLayout: ...

    def compose(self, other: LinearLayout) -> LinearLayout: ...

    def invert_and_compose(self, other: LinearLayout) -> LinearLayout: ...

    def invert(self) -> LinearLayout: ...

    def pseudoinvert(self) -> LinearLayout: ...

    def is_surjective(self) -> bool: ...

    def is_injective(self) -> bool: ...

    def is_invertible(self) -> bool: ...

    def get_in_dim_names(self) -> List[str]: ...

    def get_out_dim_names(self) -> List[str]: ...

    @property
    def bases(self) -> List[Tuple[str, List[List[int]]]]: ...

    @property
    def out_dims(self) -> List[Tuple[str, int]]: ...

    @property
    def num_in_dims(self) -> int: ...

    @property
    def num_out_dims(self) -> int: ...

    def __mul__(self, other: LinearLayout) -> LinearLayout: ...

    def __imul__(self, other: LinearLayout) -> LinearLayout: ...

    def get_shared_view(self, useHWPointOfView: bool) -> str: ...

    def get_distributed_view(self, useHWPointOfView: bool) -> str: ...

    def get_matrix_view(self) -> List[List[int]]: ...

    def apply(
        self, inputs: Sequence[Tuple[str, int]]
    ) -> List[Tuple[str, int]]: ...

    def __eq__(self, other: object) -> bool: ...

    def __ne__(self, other: object) -> bool: ...

    def __repr__(self) -> str: ...

    def __str__(self) -> str: ...
