def make_onehot(int_list, one_hot_length):
    'Convert each int to a one-hot vector.\n\n  A one-hot vector is 0 everywhere except at the index equal to the\n  encoded value.\n\n  For example: 5 as a one-hot vector is [0, 0, 0, 0, 0, 1, 0, 0, 0, ...]\n\n  Args:\n    int_list: A list of ints, each of which will get a one-hot encoding.\n    one_hot_length: The length of the one-hot vector to be created.\n  Returns:\n    A list of one-hot encodings of the ints.\n  '
    return [[(1.0 if (j == i) else 0.0) for j in range(one_hot_length)] for i in int_list]
Convert each int to a one-hot vector.

A one-hot vector is 0 everywhere except at the index equal to the
encoded value.

For example: 5 as a one-hot vector is [0, 0, 0, 0, 0, 1, 0, 0, 0, ...]

Args:
  int_list: A list of ints, each of which will get a one-hot encoding.
  one_hot_length: The length of the one-hot vector to be created.
Returns:
  A list of one-hot encodings of the ints.
def make_onehot(int_list, one_hot_length):
    'Convert each int to a one-hot vector.\n\n  A one-hot vector is 0 everywhere except at the index equal to the\n  encoded value.\n\n  For example: 5 as a one-hot vector is [0, 0, 0, 0, 0, 1, 0, 0, 0, ...]\n\n  Args:\n    int_list: A list of ints, each of which will get a one-hot encoding.\n    one_hot_length: The length of the one-hot vector to be created.\n  Returns:\n    A list of one-hot encodings of the ints.\n  '
    return [[(1.0 if (j == i) else 0.0) for j in range(one_hot_length)] for i in int_list]