importmathdefget_compatible_batch_size(batch_size,neg_sample_size):ifneg_sample_size<batch_sizeandbatch_size%neg_sample_size!=0:old_batch_size=batch_sizebatch_size=int(math.ceil(batch_size/neg_sample_size)*neg_sample_size)print('batch size ({}) is incompatible to the negative sample size ({}). Change the batch size to {}'.format(old_batch_size,neg_sample_size,batch_size))returnbatch_size