When Tokenizer is initialized with a float instead of an integer for the parameter num_words, no error is raised. However when the method Tokenizer.texts_to_matrix is called, it results in TypeError at line 413 of text.py (x = np.zeros((len(sequences), num_words))) since numpy array shape cannot be specify with float.
Would not it be preferable that this error is raised in the instanciation part or that a float to integer cast is made when possible ?
When Tokenizer is initialized with a float instead of an integer for the parameter
num_words
, no error is raised. However when the methodTokenizer.texts_to_matrix
is called, it results in TypeError at line 413 of text.py (x = np.zeros((len(sequences), num_words))
) since numpy array shape cannot be specify with float.Would not it be preferable that this error is raised in the instanciation part or that a float to integer cast is made when possible ?
Code snippet :