def calc_row_col(self, num_ex, num_items):
num_rows_per_ex = int(np.ceil(num_items / self.max_num_col))
if num_items > self.max_num_col:
num_col = self.max_num_col
num_row = num_rows_per_ex * num_ex
else:
num_row = num_ex
num_col = num_items
def calc(ii, jj):
col = jj % self.max_num_col
row = num_rows_per_ex * ii + int(jj / self.max_num_col)
return row, col
return num_row, num_col, calc
评论列表
文章目录