planarTensor(tensor:name:)
Returns a real-valued tensor from a complex-valued tensor with real and imaginary planes separated.
Declaration
func planarTensor(tensor: MPSGraphTensor, name: String?) -> MPSGraphTensorParameters
- tensor:
The input tensor.
- name:
An optional string which serves as an identifier for the operation..
Return Value
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion
Creates a complexToPlanar operation and returns the result tensor. In case the input tensor is a complex tensor the result tensor is twice as wide as the input tensor in the last dimension, and its datatype will be the underlying datatype of the input tensor - for example <3xcomplex<f16>> becomes <6xf16>. In case the input is not complex-valued, this op simply returns the input tensor. For complex input:
{ resultTensor[...,i] = realPart(inputTensor[...,i])
{ resultTensor[...,i+DimSize(inputTensor,-1)] = imagPart(inputTensor[...,i])For real-valued input:
resultTensor = inputTensor