Rate this Page

torch.linalg.solve_ex#

torch.linalg.solve_ex(A,B,*,left=True,check_errors=False,out=None)#

A version ofsolve() that does not perform error checks unlesscheck_errors= True.It also returns theinfo tensor returned byLAPACK’s getrf.

Note

When the inputs are on a CUDA device, this function synchronizes only whencheck_errors= True.

Warning

This function is “experimental” and it may change in a future PyTorch release.

Parameters

A (Tensor) – tensor of shape(*, n, n) where* is zero or more batch dimensions.

Keyword Arguments
  • left (bool,optional) – whether to solve the systemAX=BAX=B orXA=BXA = B. Default:True.

  • check_errors (bool,optional) – controls whether to check the content ofinfos and raisean error if it is non-zero. Default:False.

  • out (tuple,optional) – tuple of two tensors to write the output to. Ignored ifNone. Default:None.

Returns

A named tuple(result, info).

Examples:

>>>A=torch.randn(3,3)>>>Ainv,info=torch.linalg.solve_ex(A)>>>torch.dist(torch.linalg.inv(A),Ainv)tensor(0.)>>>infotensor(0, dtype=torch.int32)