class_docstr: Implementation of the adversarial patch attack for square and rectangular images and videos in TensorFlow v2.
  
  | Paper link: https://arxiv.org/abs/1712.09665
docstr: Return a circular patch mask.
docstr_tok: ["Return","a","circular","patch","mask","."]
code: def _get_circular_patch_mask(
      self, nb_samples: int, sharpness: int = 40
  ) -> "tf.Tensor":
      """
      Return a circular patch mask.
      """
      import tensorflow as tf
  
      diameter = np.minimum(
          self.patch_shape[self.i_h_patch],
          self.patch_shape[self.i_w_patch],
      )
  
      x = np.linspace(-1, 1, diameter)
      y = np.linspace(-1, 1, diameter)
      x_grid, y_grid = np.meshgrid(x, y, sparse=True)
      z_grid = (x_grid**2 + y_grid**2) ** sharpness
  
      image_mask = 1 - np.clip(z_grid, -1, 1)
      image_mask = np.expand_dims(image_mask, axis=2)
      image_mask = np.broadcast_to(image_mask, self.patch_shape)
      image_mask = tf.stack([image_mask] * nb_samples)
      return image_mask
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import math
  from typing import Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.attacks.attack import EvasionAttack
  from art.attacks.evasion.adversarial_patch.utils import insert_transformed_patch
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.utils import check_and_transform_label_format, is_probability, to_categorical
  from art.summary_writer import SummaryWriter
label_desc: Use image node_id 5 for calling the AdversarialPatchTensorFlowV2 obj's underlying member method code with example usage: obj._get_circular_patch_mask(nb_samples, sharpness) and returns: image_mask