parameters: (op_type, inputs, op_dtypes, attrs=None)
return_statement: return op
docstring: Utility to create an op.
docstring_summary: Utility to create an op.
docstring_tokens: Utility to create an op .
function: def _create_op(op_type, inputs, op_dtypes, attrs=None):
    """Utility to create an op."""
    op = ops.get_default_graph().create_op(
        op_type, inputs, op_dtypes, attrs=attrs, compute_device=True)
    flat_attrs = []
    # The tape expects an alternating flat list of names and attribute values.
    for a in attrs:
      flat_attrs.append(str(a))
      flat_attrs.append(op.get_attr(str(a)))
    execute.record_gradient(op_type, op.inputs, tuple(flat_attrs), op.outputs[:])
    return op
function_tokens: def _create_op ( op_type , inputs , op_dtypes , attrs = None ) : op = ops . get_default_graph ( ) . create_op ( op_type , inputs , op_dtypes , attrs = attrs , compute_device = True ) flat_attrs = [ ] # The tape expects an alternating flat list of names and attribute values. for a in attrs : flat_attrs . append ( str ( a ) ) flat_attrs . append ( op . get_attr ( str ( a ) ) ) execute . record_gradient ( op_type , op . inputs , tuple ( flat_attrs ) , op . outputs [ : ] ) return op