parameters: (grads, op)
docstring: Verify that gradients are valid in number and type.
  
    Args:
      grads: List of generated gradients.
      op: Operation for which the gradients where generated.
  
    Raises:
      ValueError: if sizes of gradients and inputs don't match.
      TypeError: if type of any gradient is not valid for its input.
docstring_summary: Verify that gradients are valid in number and type.
docstring_tokens: Verify that gradients are valid in number and type .
function: def _VerifyGeneratedGradients(grads, op):
    """Verify that gradients are valid in number and type.
  
    Args:
      grads: List of generated gradients.
      op: Operation for which the gradients where generated.
  
    Raises:
      ValueError: if sizes of gradients and inputs don't match.
      TypeError: if type of any gradient is not valid for its input.
    """
    if len(grads) != len(op.inputs):
      raise ValueError("Num gradients %d generated for op %s do not match num "
                       "inputs %d" % (len(grads), op.node_def, len(op.inputs)))
function_tokens: def _VerifyGeneratedGradients ( grads , op ) : if len ( grads ) != len ( op . inputs ) : raise ValueError ( "Num gradients %d generated for op %s do not match num " "inputs %d" % ( len ( grads ) , op . node_def , len ( op . inputs ) ) )