def METHOD_NAME(self, x, y_object=None, y_patch_metadata=None, threat_model="digital"):
    num_imgs = x.shape[0]
    attacked_images = []
    if threat_model == "digital":
        for i in range(num_imgs):
            gs_coords = y_patch_metadata[i]["gs_coords"]
            shape = y_patch_metadata[i]["shape"].tobytes().decode("utf-8")
            img_mask = self._compute_image_mask(
                x[i], y_object[i]["area"], gs_coords, shape
            )
            img_with_patch = super().METHOD_NAME(
                np.expand_dims(x[i], axis=0), y=[y_object[i]], mask=img_mask
            )[0]
            attacked_images.append(img_with_patch)
    else:
        raise NotImplementedError(
            "physical threat model not available for masked PGD attack"
        )
    return np.array(attacked_images)