def METHOD_NAME(cls, storage, dtype, metadata):
    storage_offset, size, stride, requires_grad, meta_dict = metadata
    storage = storage._untyped_storage if hasattr(storage, "_untyped_storage") else storage
    t = cls([], dtype=dtype, device=storage.device)
    t.set_(storage, storage_offset, size, stride)
    t.requires_grad = requires_grad
    t.__dict__ = meta_dict
    return t