<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_batch(self, datapoints):
 """ Adds a batch of datapoints to the tensor if room is available. """

        num_datapoints_to_add = datapoints.shape[0]
        end_index = self.cur_index + num_datapoints_to_add
        if end_index <= self.num_datapoints:
            self.data[self.cur_index:end_index,...] = datapoints
            self.cur_index = end_index