Retrieves a reference to the tensor of the supplied rank, throws if the stored tensor has a different rank.
References tensor.