def METHOD_NAME(obj: Any) -> Any:
    """
    Required to handle the situation when multiple references to one and the
    same tensor are present in the input. If tensor replication is not done, then
    at runtime one and the same tensor could be wrapped by input/output wrappers twice,
    which will disrupt the traced graph structure and possibly hook calls.
    """
    observed_tensor_object_ids = set()  # type: Set[int]
    def replicate_fn(tensor: torch.Tensor) -> torch.Tensor:
        tensor_object_id = id(tensor)
        if tensor_object_id in observed_tensor_object_ids:
            with forward_nncf_trace():
                return tensor.clone()
        observed_tensor_object_ids.add(tensor_object_id)
        return tensor
    obj = objwalk(obj, is_tensor, replicate_fn)
    return obj