code: def checker_mask(shape):
      mask = tensor(0.0)
      for size in shape:
          mask = mask.unsqueeze(-1) + torch.arange(float(size))
      return mask.fmod(2).bool()
  
file_path: pyro/tests/distributions/test_mask.py
imports: import pytest
  import torch
  from torch import tensor
  from torch.distributions import kl_divergence
  from pyro.distributions.torch import Bernoulli, Normal
  from pyro.distributions.util import broadcast_shape, scale_and_mask
  from tests.common import assert_equal
label_desc: Use image node_id 1 for calling a global function with example usage: checker_mask(shape) and returns: mask