As you know tf.one_hot can do the one hot encoding. However, when my dataset is very large, I need to do batch trainning. In this way, when i use a for loop to loop over all batches, in each iteration, when i do tf.one_hot, the dimension of one hot matrix will be smaller than i expected.
For example, for column 'a' we have 47 categories, but in one batch their might be only 20 shown, and when i do one_hot on this batch, it will create a matrix with dimension of rows * 20 instead of a dimension of rows * 47.
How to get a dimension of rows * 47 one hot matrix in each batch?
Thank you!