parameters: (attr_value)
return_statement: return ret
docstring: Returns the value of the attr of this buf with the given `name`.
  
    Args:
      attr_value: attrvalue protobuf.
  
    Returns:
      The value of the attr, as a Python object.
  
    Raises:
      ValueError: If this op does not have an attr with the given `name`.
docstring_summary: Returns the value of the attr of this buf with the given `name`.
docstring_tokens: Returns the value of the attr of this buf with the given name .
function: def get_attr_proto_value(attr_value):
    """Returns the value of the attr of this buf with the given `name`.
  
    Args:
      attr_value: attrvalue protobuf.
  
    Returns:
      The value of the attr, as a Python object.
  
    Raises:
      ValueError: If this op does not have an attr with the given `name`.
    """
    fields = ["s", "i", "f", "b", "type", "shape", "tensor", "func"]
  
    x = attr_value
    ret = []
    # Treat an empty oneof value as an empty list.
    if not x.WhichOneof("value"):
      return ret
    if x.HasField("list"):
      for f in fields:
        if getattr(x.list, f):
          if f == "type":
            ret += [tf_dtypes.as_dtype(x) for x in list(getattr(x.list, f))]
          else:
            ret += list(getattr(x.list, f))
    else:
      for f in fields:
        if x.HasField(f):
          if f == "type":
            ret = tf_dtypes.as_dtype(getattr(x, f))
          else:
            ret = getattr(x, f)
    return ret
function_tokens: def get_attr_proto_value ( attr_value ) : fields = [ "s" , "i" , "f" , "b" , "type" , "shape" , "tensor" , "func" ] x = attr_value ret = [ ] # Treat an empty oneof value as an empty list. if not x . WhichOneof ( "value" ) : return ret if x . HasField ( "list" ) : for f in fields : if getattr ( x . list , f ) : if f == "type" : ret += [ tf_dtypes . as_dtype ( x ) for x in list ( getattr ( x . list , f ) ) ] else : ret += list ( getattr ( x . list , f ) ) else : for f in fields : if x . HasField ( f ) : if f == "type" : ret = tf_dtypes . as_dtype ( getattr ( x , f ) ) else : ret = getattr ( x , f ) return ret