Gensim LDA topic assignment

dictionary = corpora.Dictionary(texts)
corpus = [dictionary.doc2bow(text) for text in texts]


test =LDA[corpus[0]]
print(test)
sorted(test, reverse=True, key=lambda x: x[1])

Topics = ['Topic_'+str(sorted(LDA[i], reverse=True, key=lambda x: x[1])[0][0]).zfill(3) for i in corpus]

There is no other builtin Gensim function that will give the topic assignment vectors directly.

Your question is valid that LDA algorithm has passed through the documents but implementation of LDA is working by updating the model in chunks (based on value of chunksize parameter), hence it will not keep the entire corpus in-memory.

Hence you have to use lda[corpus] or use the method lda.get_document_topics()