Tensor Multiplication
In this article we continue our quick start series. We assume that you are following from the previous article.
5. Create a Compute Request for Matrix Multiplication
We will create a ComputeRequest
to perform homomorphic matrix multiplication.
Explanation:
We create two
ComputeOperationOperand
objects representing the serialized tensors.We specify that the data type is
TENSOR
and the encryption type isCIPHERTEXT
.We define a
ComputeOperationInstance
for the multiplication operation with two operands.The
ComputeRequest
is created with this operation instance.
6. Send the Compute Request and Receive the Response
We send the request to the network and receive the encrypted result.
Explanation:
We measure the time before and after the computation to calculate the duration.
The
compute
method sends the request and populates theres
pointer with the response.We check the
status
of the response to ensure the computation was successful.
Last updated