def METHOD_NAME(t, mask):
  """Apply a mask to a tensor.
  If not None, mask should be a t.shape[:-1] tensor of 0,1 values.
  Args:
    t: Input tensor.
    mask: Boolean mask with shape == t.shape[:-1]. If None, nothing happens.
  Returns:
    A tensor with the same shape as the input tensor.
  Raises:
    ValueError: If shapes do not match.
  """
  warnings.warn("Mask is deprecated. "
                "Will be removed in DeepChem 1.4.", DeprecationWarning)
  if mask is None:
    return t
  if not t.get_shape()[:-1].is_compatible_with(mask.get_shape()):
    raise ValueError(
        'Shapes do not match: %s vs. %s' % (t.get_shape(), mask.get_shape()))
  return tf.multiply(t, tf.expand_dims(mask, -1))