from typing import Any
import torch


def tensor_in_device(data: Any, device: str = "cpu", **kwargs) -> torch.Tensor:
    """Create tensor in device.

    Args:
        data (Any): data on the tensor.
        device (str, optional): string of the device to be created in.
            Defaults to "cpu".

    Returns:
        torch.Tensor: tensor in device.
    """
    return torch.Tensor(data, **kwargs).to(device)