Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A temporal python class for PyTorch-ComplexTensor
A Python class to perform as ComplexTensor
in PyTorch: Nothing except for the following,
class ComplexTensor:
def __init__(self, ...):
self.real = torch.Tensor(...)
self.imag = torch.Tensor(...)
PyTorch is great DNN Python library, except that it doesn't support ComplexTensor
in Python level.
https://github.com/pytorch/pytorch/issues/755
I'm looking forward to the completion, but I need ComplexTensor
for now.
I created this cheap module for the temporal replacement of it. Thus, I'll throw away this project as soon as ComplexTensor
is completely supported!
Python>=3.6
PyTorch>=1.0
pip install torch_complex
import numpy as np
from torch_complex.tensor import ComplexTensor
real = np.random.randn(3, 10, 10)
imag = np.random.randn(3, 10, 10)
x = ComplexTensor(real, imag)
x.numpy()
x + x
x * x
x - x
x / x
x ** 1.5
x @ x # Batch-matmul
x.conj()
x.inverse() # Batch-inverse
All are implemented with combinations of computation of RealTensor
in python level, thus the speed is not good enough.
import torch_complex.functional as F
F.cat([x, x])
F.stack([x, x])
F.matmul(x, x) # Same as x @ x
F.einsum('bij,bjk,bkl->bil', [x, x, x])
Almost all methods that torch.Tensor
has are implemented.
x.cuda()
x.cpu()
(x + x).sum().backward()
FAQs
A fugacious python class for PyTorch-ComplexTensor
We found that torch-complex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.