def _create_degrees(input_size,<EOL>hidden_units=None,<EOL>input_order="<STR_LIT>",<EOL>hidden_degrees="<STR_LIT>"):
input_order = _create_input_order(input_size, input_order)<EOL>degrees = [input_order]<EOL>if hidden_units is None:<EOL><INDENT>hidden_units = []<EOL><DEDENT>for units in hidden_units:<EOL><INDENT>if isinstance(hidden_degrees, six.string_types):<EOL><INDENT>if hidden_degrees == "<STR_LIT>":<EOL><INDENT>degrees.append(<EOL>np.random.randint(low=min(np.min(degrees[-<NUM_LIT:1>]), input_size - <NUM_LIT:1>),<EOL>high=input_size,<EOL>size=units))<EOL><DEDENT>elif hidden_degrees == "<STR_LIT>":<EOL><INDENT>min_degree = min(np.min(degrees[-<NUM_LIT:1>]), input_size - <NUM_LIT:1>)<EOL>degrees.append(np.maximum(<EOL>min_degree,<EOL>np.ceil(np.arange(<NUM_LIT:1>, units + <NUM_LIT:1>)<EOL>* (input_size - <NUM_LIT:1>) / float(units + <NUM_LIT:1>)).astype(np.int32)))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(hidden_degrees))<EOL><DEDENT><DEDENT>return degrees<EOL>
Returns a list of degree vectors, one for each input and hidden layer.

    A unit with degree d can only receive input from units with degree < d. Output
    units always have the same degree as their associated input unit.

    Args:
      input_size: Number of inputs.
      hidden_units: list with the number of hidden units per layer. It does not
        include the output layer. Each hidden unit size must be at least the size
        of length (otherwise autoregressivity is not possible).
      input_order: Order of degrees to the input units: 'random', 'left-to-right',
        'right-to-left', or an array of an explicit order. For example,
        'left-to-right' builds an autoregressive model
        p(x) = p(x1) p(x2 | x1) ... p(xD | x<D).
      hidden_degrees: Method for assigning degrees to the hidden units:
        'equal', 'random'.  If 'equal', hidden units in each layer are allocated
        equally (up to a remainder term) to each degree.  Default: 'equal'.

    Raises:
      ValueError: invalid input order.
      ValueError: invalid hidden degrees.