'Get gradient values as numpy array w.r.t the list of `tensors`. If a
tensor is not used, its gradient will be set to zero.
Arguments:
Tensors (list): List of Tensors to compute gradients.
Returns
list: A list of numpy.ndarray, each of them is the gradient of the
input tensor.'

def get_grad_asnumpyarray(self, tensors):

    grad_vals = self.get_grad_tensor(tensors)
    for i in range(len(grad_vals)):
        grad_vals[i] = grad_vals[i].get().astype(self.dtype)
    return grad_vals
