def get_control_flag(control, field): return tf.equal(tf.mod(tf.floor_div(control, field), 2), 1)
def project_outer(self, index): """Projects an index with the same index set onto the outer components.""" return IndexMap(indices=tf.floor_div(index.indices, self.inner_index.num_segments), num_segments=self.outer_index.num_segments, batch_dims=index.batch_dims)