decrypt_to_pytorch_tensor
Engine.decrypt_to_pytorch_tensor(ciphertext, secret_key)- Decrypts a ciphertext and returns the result as a PyTorch tensor. If the engine's mode is set to GPU, the resulting tensor will also be allocated on the GPU.
- Input:
- Ciphertext
- SecretKey
- Output:
- Plaintext
Examples
CPU
import torch
from desilofhe import Engine
engine = Engine()
secret_key = engine.create_secret_key()
tensor = torch.tensor([1, 2, 3])
encrypted = engine.encrypt_pytorch_tensor(tensor, secret_key)
decrypted = engine.decrypt_to_pytorch_tensor(encrypted, secret_key)
GPU