tasks/vowels/test.py
def onehot(index, size):
    """
    Create a numpy vector that has all zeros except at index. index has the value 1.
    :param index: The index where the vector should be one.
    :param size: The length of the vector.
    :return: A one-hot vector encoding for the given index.
    """
    vec = np.zeros(size, dtype=np.float32)
    vec[index] = 1.0
    return vec

    Create a numpy vector that has all zeros except at index. index has the value 1.
    :param index: The index where the vector should be one.
    :param size: The length of the vector.
    :return: A one-hot vector encoding for the given index.
    
Create a numpy vector that has all zeros except at index. index has the value 1.
Create a numpy vector that has all zeros except at index . index has the value 1 .
def onehot(index, size):
    vec = np.zeros(size, dtype=np.float32)
    vec[index] = 1.0
    return vec
def onehot ( index , size ) : vec = np . zeros ( size , dtype = np . float32 ) vec [ index ] = 1.0 return vec
Create a numpy vector that has all zeros except at index.
Create a numpy vector that has all zeros except at index .
"""
    Create a numpy vector that has all zeros except at index. index has the value 1.
    :param index: The index where the vector should be one.
    :param size: The length of the vector.
    :return: A one-hot vector encoding for the given index.
    """
A one-hot vector encoding for the given index.
A one - hot vector encoding for the given index .
index
The index where the vector should be one.
The index where the vector should be one .
size
The length of the vector.
The length of the vector .