// implementation
// https://github.com/tensorflow/tensorflow/issues/206
curr_core = tt_a.tt_cores[core_idx]
left_rank = tf.shape(curr_core)[0]right_rank = tf.shape(curr_core)[-1]
curr_core = tf.transpose(curr_core, (1, 2, 0, 3))
curr_core = tf.reshape(curr_core, (-1, left_rank, right_rank))
// Ravel multiindex (row_idx[:, core_idx], col_idx[:, core_idx]) into
// a linear index to use tf.gather that supports only first dimensional
// gather.
After Change
curr_core_shape = (a_shape[0][core_idx]*a_shape[1][core_idx], left_rank,
right_rank)
// TODO: test with partually known shape (e.g. tt_ranks are undefined).
curr_core_shape = tf.TensorShape(curr_core_shape)
curr_core = tf.reshape(curr_core, curr_core_shape)
// Ravel multiindex (row_idx[:, core_idx], col_idx[:, core_idx]) into
// a linear index to use tf.gather that supports only first dimensional
// gather.