(d_real, d_fake, d_real_logits, d_fake_logits)
Checks the shapes and ranks of logits and prediction tensors.

  Args:
    d_real: prediction for real points, values in [0, 1], shape [batch_size, 1].
    d_fake: prediction for fake points, values in [0, 1], shape [batch_size, 1].
    d_real_logits: logits for real points, shape [batch_size, 1].
    d_fake_logits: logits for fake points, shape [batch_size, 1].

  Raises:
    ValueError: if the ranks or shapes are mismatched.
Checks the shapes and ranks of logits and prediction tensors.
Checks the shapes and ranks of logits and prediction tensors .
def check_dimensions(d_real, d_fake, d_real_logits, d_fake_logits):
  """Checks the shapes and ranks of logits and prediction tensors.

  Args:
    d_real: prediction for real points, values in [0, 1], shape [batch_size, 1].
    d_fake: prediction for fake points, values in [0, 1], shape [batch_size, 1].
    d_real_logits: logits for real points, shape [batch_size, 1].
    d_fake_logits: logits for fake points, shape [batch_size, 1].

  Raises:
    ValueError: if the ranks or shapes are mismatched.
  """
  def _check_pair(a, b):
    if a != b:
      raise ValueError("Shape mismatch: %s vs %s." % (a, b))
    if len(a) != 2 or len(b) != 2:
      raise ValueError("Rank: expected 2, got %s and %s" % (len(a), len(b)))

  if (d_real is not None) and (d_fake is not None):
    _check_pair(d_real.shape.as_list(), d_fake.shape.as_list())
  if (d_real_logits is not None) and (d_fake_logits is not None):
    _check_pair(d_real_logits.shape.as_list(), d_fake_logits.shape.as_list())
  if (d_real is not None) and (d_real_logits is not None):
    _check_pair(d_real.shape.as_list(), d_real_logits.shape.as_list())
def check_dimensions ( d_real , d_fake , d_real_logits , d_fake_logits ) : def _check_pair ( a , b ) : if a != b : raise ValueError ( "Shape mismatch: %s vs %s." % ( a , b ) ) if len ( a ) != 2 or len ( b ) != 2 : raise ValueError ( "Rank: expected 2, got %s and %s" % ( len ( a ) , len ( b ) ) ) if ( d_real is not None ) and ( d_fake is not None ) : _check_pair ( d_real . shape . as_list ( ) , d_fake . shape . as_list ( ) ) if ( d_real_logits is not None ) and ( d_fake_logits is not None ) : _check_pair ( d_real_logits . shape . as_list ( ) , d_fake_logits . shape . as_list ( ) ) if ( d_real is not None ) and ( d_real_logits is not None ) : _check_pair ( d_real . shape . as_list ( ) , d_real_logits . shape . as_list ( ) )