add support for Torch