def clone(self) -> Tensor:
    """
    Creates a clone of this tensor allocating a separate buffer for the data.
    """
    ret = Tensor.empty(self.shape, device=self.device, dtype=self.dtype)
    if self.grad is not None: ret.grad = self.grad.clone()
    return ret.assign(self)

    Creates a clone of this tensor allocating a separate buffer for the data.
    
tinygrad/tensor.py