-
Notifications
You must be signed in to change notification settings - Fork 159
Open
@anjali411
) and tanh, neg functions defined (
) which are actually unnecessary since these functions are supported for complex numbers in the last couple of releases of PyTorch and would be much faster too (since we call into blas operation for matmul for example).
Description
Hi I noticed that you have custom matmul (
complexPyTorch/complexPyTorch/complexFunctions.py
Lines 11 to 19 in a4e752c
def complex_matmul(A, B):
'''
Performs the matrix product between two complex matricess
'''
outp_real = torch.matmul(A.real, B.real) - torch.matmul(A.imag, B.imag)
outp_imag = torch.matmul(A.real, B.imag) + torch.matmul(A.imag, B.real)
return outp_real.type(torch.complex64) + 1j * outp_imag.type(torch.complex64)
complexPyTorch/complexPyTorch/complexFunctions.py
Lines 52 to 56 in a4e752c
def complex_tanh(input):
return tanh(input.real).type(torch.complex64)+1j*tanh(input.imag).type(torch.complex64)
def complex_opposite(input):
return -(input.real).type(torch.complex64)+1j*(-(input.imag).type(torch.complex64))
Metadata
Metadata
Assignees
Labels
No labels