db073909d05ae6f91b7abd8d6251bfa247349447,qucumber/utils/cplx.py,,conjugate,#,226
Before Change
:rtype: torch.Tensor
if x.dim() == 1 or x.dim() == 2:
z = torch.zeros_like(x)
z[0] = x[0]
z[1] = -x[1]
if x.dim() == 3:
z = torch.zeros(2, x.size()[2], x.size()[1], dtype=x.dtype, device=x.device)
z[0] = torch.transpose(x[0], 0, 1)
z[1] = -torch.transpose(x[1], 0, 1)
return z
def elementwise_mult(x, y):
Alias for :func:`scalar_mult`.
After Change
:rtype: torch.Tensor
if x.dim() < 3:
return conj(x)
else:
return make_complex(
torch.transpose(real(x), 0, 1), -torch.transpose(imag(x), 0, 1)
)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: PIQuIL/QuCumber
Commit Name: db073909d05ae6f91b7abd8d6251bfa247349447
Time: 2019-12-31
Author: emerali@users.noreply.github.com
File Name: qucumber/utils/cplx.py
Class Name:
Method Name: conjugate
Project Name: explosion/thinc
Commit Name: c6e83948f53bcd5d77b1714b691bbd74d12da613
Time: 2020-01-19
Author: honnibal+gh@gmail.com
File Name: thinc/initializers.py
Class Name:
Method Name: zero_init
Project Name: SheffieldML/GPy
Commit Name: 317eef33f8d8a0c9c8e291c4c123f39f543201f8
Time: 2015-04-30
Author: alan.daniel.saul@gmail.com
File Name: GPy/mappings/constant.py
Class Name: Constant
Method Name: gradients_X