def create_perturbable_object(object_image, mask, initial_value=0, sign_grad=True):
    """
        Create perturbable object using mask to define perturbable area. Will also initialize
        perturbable area to initial_value. Gradients of this perturbable object will be masked
        and magnitudeless, if sign_grad=True.

        Parameters:
            object_image (torch.Tensor): Object to perturb.
            mask (torch.Tensor): Mask of perturbable area of object.
            initial_value (int): Initial value to set perturbable area. (default: 0)
            sign_grad (bool): Whether to remove gradient magnitude for the gradient of the perturbable object. (default: True)

        Returns:
            torch.Tensor[1, C, H, W]: Perturbable object that requires gradients.
    """
    object_rgb = object_image[:, :3, :, :]
    object_alpha = object_image[:, 3:, :, :]

    perturbed_object = object_image.clone()
    perturbed_object[:, :3, :, :] = object_rgb*(1 - mask) + initial_value*mask
    perturbed_object[:, 3:, :, :] = object_alpha

    perturbed_object.requires_grad_(True)
    perturbed_object.register_hook(lambda grad: grad*mask)
    if sign_grad:
        perturbed_object.register_hook(lambda grad: grad.sign())

    return perturbed_object