e()
    tensor([1.5708, 0.7854])
    

##  Linear Algebra  ¶

Currently, there is very minimal linear algebra operation support for complex
tensors. We currently support [ ` torch.mv()  `
](generated/torch.mv.html#torch.mv "torch.mv") , [ ` torch.svd()  `
](generated/torch.svd.html#torch.svd "torch.svd") , [ ` torch.qr()  `
](generated/torch.qr.html#torch.qr "torch.qr") , and [ ` torch.inverse()  `
](generated/torch.inverse.html#torch.inverse "torch.inverse") (the latter
three are only supported on CPU). However we are working to add support for
more functions soon: [ ` torch.matmul()  `
](generated/torch.matmul.html#torch.matmul "torch.matmul") , [ ` torch.solve()
` ](generated/torch.solve.html#torch.solve "torch.solve") , [ ` torch.eig()  `
](generated/torch.eig.html#torch.eig "torch.eig") , [ ` torch.symeig()  `
](generated/torch.symeig.html#torch.symeig "torch.symeig") . If any of these
would help your use case, please [ search
](https://github.com/pytorch/pytorch/issues?q=is%3Aissue+is%3Aopen+complex) if
an issue has already been filed and if not, [ file one
](https://github.com/pytorch/pytorch/issues/new/choose) .

##  Serialization  ¶

Complex tensors can be serialized, allowing data to be saved as complex
values.

    
    
    >>> torch.save(y, 'complex_tensor.pt')
    >>> torch.load('complex_tensor.pt')
    tensor([ 0.6125-0.1681j, -0.3773+1.3487j, -0.0861-0.7981j])
    

##  Autograd  ¶

PyTorch supports autograd for complex tensors. The autograd APIs can be used
for both holomorphic and non-holomorphic functions. For holomorphic functions,
you get the regular complex gradient. For  C  →  R  C → R  C  →  R  real-
valued loss functions,  grad.conj()  gives a descent direction. For more
details, check out the note [ Autograd for Complex Numbers
](notes/autograd.html#complex-autograd-doc) .

We do not support the following subsystems:

  * Quantization 

  * JIT 

  * Sparse Tensors 

  * Distributed 

If any of these would help your use case, please [ search
](https://github.com/pytorch/pytorch/issues?q=is%3Aissue+is%3Aopen+complex) if
an issue has already been filed and if not, [ file one
](https://github.com/pytorch/pytorch/issues/new/choose) .

[ Next ![](_static/images/chevron-right-orange.svg) ](quantization.html
"Quantization") [ ![](_static/images/chevron-right-orange.svg) Previous
](optim.html "torch.optim")

* * *

© Copyright 2019, Torch Contributors.

Built with [ Sphinx ](http://sphinx-doc.org/) using a [ theme
](https://github.com/rtfd/sphinx_rtd_theme) provided by [ Read the Docs
](https://readthedocs.org) .

  * Complex Numbers 
    * Creating Complex Tensors 
    * Transition from the old representation 
    * Accessing real and imag 
    * Angle and abs 
    * Linear Algebra 
    * Serialization 
    * Autograd 

![](https://www.googleadservices.com/pagead/conversion/795629140/?label=txkmCPmdtosBENSssfsC&guid=ON&script=0)

##  Docs

Access comprehensive developer documentation for PyTorch

[ View Docs ](https://pytorch.org/docs/stable/index.html)

##  Tutorials

Get in-depth tutorials for beginners and advanced developers

[ View Tutorials ](https://pytorch.org/tutorials)

##  Resources

Find development resources and get your questions answered

[ View Resources ](https://pytorch.org/resources)

[ ](https://pytorch.org/)

  * [ PyTorch ](https://pytorch.org/)
  * [ Get Started ](https://pytorch.org/get-started)
  * [ Features ](https://pytorch.org/features)
  * [ Ecosystem ](https://pytorch.org/ecosystem)
  * [ Blog ](https://pytorch.org/blog/)
  * [ Contributing ](https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md)

  * [ Resources ](https://pytorch.org/resources)
  * [ Tutorials ](https://pytorch.org/tutorials)
  * [ Docs ](https://pytorch.org/docs/stable/index.html)
  * [ Discuss ](https://discuss.pytorch.org)
  * [ Github Issues ](https://github.com/pytorch/pytorch/issues)
  * [ Brand Guidelines ](https://pytorch.org/assets/brand-guidelines/PyTorch-Brand-Guidelines.pdf)

  * Stay Conn