code: def replace_masked_values(tensor, mask, replace_with):
      """
      Replaces all masked values in ``tensor`` with ``replace_with``.  ``mask`` must be broadcastable
      to the same shape as ``tensor``. We require that ``tensor.dim() == mask.dim()``, as otherwise we
      won't know which dimensions of the mask to unsqueeze.
      """
      # We'll build a tensor of the same shape as `tensor`, zero out masked values, then add back in
      # the `replace_with` value.
      if tensor.dim() != mask.dim():
          raise ConfigurationError(
              "tensor.dim() (%d) != mask.dim() (%d)"
              % (tensor.dim(), mask.dim())
          )
      one_minus_mask = 1.0 - mask
      values_to_add = replace_with * one_minus_mask
      return tensor * mask + values_to_add
  
imports: from __future__ import division
  from __future__ import absolute_import
  from collections import defaultdict
  import logging
  import math
  import torch
  from allennlp.common.checks import ConfigurationError
label_desc: Use image node_id 18 for calling a global function with example usage: replace_masked_values(tensor, mask, replace_with) and returns: unknown