torch.linalg.solve β PyTorch 2.12 documentation
Letting πΎ K be π R or πΆ C , this function computes the solution π β πΎ π Γ π XβK nΓk of the linear system associated to π΄ β πΎ π Γ π , π΅ β πΎ π Γ π AβK nΓn ,BβK nΓk , which is defined as If left= False, this function returns the matrix π β πΎ π Γ π XβK nΓk that solves the system This system of linear equations has one solution if and only if π΄ A is invertible. This function assumes that π΄ A is invertible. Supports inputs of float, double, cfloat and cdouble dtypes. Also supports batches of matrices, and if the inputs are batches of matrices then the output has the same batch dimensions. Letting * be zero or more batch dimensions, If A has shape (*, n, n) and B has shape (*, n) (a batch of vectors) or shape (*, n, k) (a batch of matrices or βmultiple right-hand sidesβ), this function returns X of shape (*, n) or (*, n, k) respectively. Otherwise, if A has shape (*, n, n) and B has shape (n,) or (n, k), B is broadcasted to have shape (*, n) or (*, n, k) res
torch.linalg.solve # torch.linalg. solve ( A , B , * , left = True , out = None ) → Tensor # Computes the solution of a square system of linear equations with a unique solution. Letting K \mathbb{K} K be R \mathbb{R} R or C \mathbb{C} C , this function computes the solution X β K n Γ k X \in \mathbb{K}^{n \times k} X β K n Γ k of the linear system associated to A β K n Γ n , B β K n Γ k A \in \mathbb{K}^{n \times n}, B \in \mathbb{K}^{n \times k} A β K n Γ n , B β K n Γ k , which is defined as A X = B AX = B A X = B If left = False , this function returns the matrix X β K n Γ k X \in \m
related reading
- https://www.deeplearningbook.org/contents/linear_algebra.htmldeeplearningbook.org
- GitHub - srush/Tensor-Puzzles: Solve puzzles. Improve your pytorch.github.com
- torch.stackdocs.pytorch.org
- Tensors β PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- torch.ones_like — PyTorch 2.12 documentationdocs.pytorch.org
- Learning PyTorch with Examples β PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- torch.Tensor — PyTorch 2.12 documentationdocs.pytorch.org
- linear algebra - If A is invertible, then it can be represented as a product of elementary matrices. - Mathematics Stack Exchangemath.stackexchange.com
- torch.zeros_like — PyTorch 2.12 documentationdocs.pytorch.org
- torch.reshape — PyTorch 2.12 documentationdocs.pytorch.org
- torch.triu — PyTorch 2.12 documentationdocs.pytorch.org
- ReLU — PyTorch 2.12 documentationdocs.pytorch.org