<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_sampled_topics(self, sampled_topics):
 """ Allocate sampled topics to the documents rather than estimate them. Automatically generate term-topic and document-topic matrices. """


        assert sampled_topics.dtype == np.int and \
            len(sampled_topics.shape) <= 2

        if len(sampled_topics.shape) == 1:
            self.sampled_topics = \
                sampled_topics.reshape(1, sampled_topics.shape[0])
        else:
            self.sampled_topics = sampled_topics

        self.samples = self.sampled_topics.shape[0]

        self.tt = self.tt_comp(self.sampled_topics)
        self.dt = self.dt_comp(self.sampled_topics)