Add support for Torch