ExTorch.Complex
(extorch v0.2.0)
Copy Markdown
An ExTorch.Complex is a struct that represents a complex number with real and imaginary parts.
Note: This struct only provides a mechanism to exchange imaginary value between Elixir and LibTorch and therefore does not provide any arithmetic functions.
Summary
Types
An ExTorch.Complex is a struct that represents a complex number with real and imaginary parts.
Functions
Create an ExTorch.Complex struct with real and imaginary parts.
Retrieve the imaginary part of a complex number
Retrieve the real part of a complex number
Types
@type t() :: %ExTorch.Complex{ imaginary: number() | :nan | :inf | :ninf, real: number() | :nan | :inf | :ninf }
An ExTorch.Complex is a struct that represents a complex number with real and imaginary parts.
Functions
Create an ExTorch.Complex struct with real and imaginary parts.
Arguments
re- The real part of the complex number (number() | :nan | :inf | :ninf)im- The imaginary part of the complex number (number() | :nan | :inf | :ninf)
Returns
complex- An imaginary number with real partreand imaginary partim(ExTorch.Complex)
Retrieve the imaginary part of a complex number
Arguments
complex- A complex number (ExTorch.Complex)
Returns
im- The imaginary part of the input complex number. (number() | :nan | :inf | :ninf)
Retrieve the real part of a complex number
Arguments
complex- A complex number (ExTorch.Complex)
Returns
re- The real part of the input complex number. (number() | :nan | :inf | :ninf)