def build_ops(): init_step = int(_get_init_step()) print('init_step is %d' % (init_step)) step = counter(init_step) schedule = step_based_schedule(config, step) ckpt_tensor = tf.as_string(step + 1) resize_op = resize_cluster(ckpt_tensor, schedule) return init_step, resize_op
def test_step_based_scheduler(): sizes = [1, 2, 4, 8] n_step = 3 config = ','.join('%d:%d' % (size, n_step) for size in sizes) expected_sizes = [1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8] schedule = step_based_schedule(config) with tf.Session() as sess: for i in range(12): size = sess.run(schedule) assert (size == expected_sizes[i])
def build_ops(): step_place = tf.placeholder(dtype=tf.int32, shape=()) new_step_op = step_based_schedule(config, step_place) resize_op = resize_cluster_from_url() return step_place, resize_op, new_step_op
def _build_resize_op(self, config, init_step): step = counter(init_step) new_size = step_based_schedule(config, step) ckpt_tensor = tf.as_string(step + 1) resize_op = resize_cluster(ckpt_tensor, new_size) return resize_op
def _build_resize_op(self, config, step): new_size_op = step_based_schedule(config, step) resize_op = resize_cluster_from_url() return resize_op, new_size_op