concrete-core 0.1.6

Concrete is a fully homomorphic encryption (FHE) library that implements Zama's variant of TFHE.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::math::tensor::Tensor;

use super::AsRefSlice;

/// This trait allows to extract the tensor of a [`Tensor`]-based type.
///
/// This trait allows to consume a value, and extracts the tensor that was wrapped inside, to
/// return it to the caller.
pub trait IntoTensor {
    /// The element type of the collection container.
    type Element;
    /// The type of the collection container.
    type Container: AsRefSlice<Element = <Self as IntoTensor>::Element>;
    /// Consumes `self` and returns an owned tensor.
    fn into_tensor(self) -> Tensor<Self::Container>;
}