class_docstr: Implementation of the adversarial texture attack on object trackers in PyTorch.
  
  | Paper link: https://arxiv.org/abs/1904.11042
class_docstr_tok: ["Implementation","of","the","adversarial","texture","attack","on","object","trackers","in","PyTorch",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1904.11042"]
docstr: Create patch mask.
  
  :param nb_samples: Number of samples.
  :return: Patch mask.
docstr_tok: ["Create","patch","mask",".",":","param","nb_samples",":","Number","of","samples",".",":","return",":","Patch","mask","."]
code: def _get_patch_mask(self, nb_samples: int) -> "torch.Tensor":
      """
      Create patch mask.
  
      :param nb_samples: Number of samples.
      :return: Patch mask.
      """
      import torch
  
      image_mask_np = np.ones((self.patch_height, self.patch_width))
  
      image_mask_np = np.expand_dims(image_mask_np, axis=2)
      image_mask_np = np.broadcast_to(image_mask_np, self.patch_shape)
      image_mask = torch.Tensor(np.array(image_mask_np)).to(
          self.estimator.device
      )
      image_mask = torch.stack([image_mask] * nb_samples, dim=0)
      return image_mask
  
imports: import logging
  from typing import Dict, List, Optional, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator, LossGradientsMixin
  from art.estimators.object_tracking.object_tracker import ObjectTrackerMixin
  from art.summary_writer import SummaryWriter
label_desc: Use image node_id 5 for calling the AdversarialTexturePyTorch obj's underlying member method code with example usage: obj._get_patch_mask(nb_samples) and returns: image_mask