The function parameter `tensor` should be renamed to disambiguate it from any tensor class used elsewhere.