code: def check(self, value):
      if value.dim() == 0:
          warnings.warn("Invalid event_shape: ()")
          return torch.tensor(False)
      batch_shape, event_shape = value.shape[:-1], value.shape[-1:]
      if event_shape != (self.num_nodes,):
          warnings.warn("Invalid event_shape: {}".format(event_shape))
          return torch.tensor(False)
      if value.min() < 0 or value.max() >= self.num_nodes:
          warnings.warn("Value out of bounds")
          return torch.tensor(False)
      counts = torch.zeros(batch_shape + (self.num_nodes,))
      counts.scatter_add_(-1, value, torch.ones(value.shape))
      if (counts != 1).any():
          warnings.warn("Matching is not binary")
          return torch.tensor(False)
      return torch.tensor(True)
  
imports: import itertools
  import logging
  import warnings
  import torch
  from torch.distributions import constraints
  from torch.distributions.utils import lazy_property
  from .torch import Categorical
  from .torch_distribution import TorchDistribution
label_desc: Use image node_id 2 for calling the OneOneMatchingConstraint obj's underlying member method code with example usage: obj.check(value) and returns: torch, torch, torch, torch, torch