def _get_column_by_index(tensor, indices):
    'Returns columns from a 2-D tensor by index.'
    shape = array_ops.shape(tensor)
    p_flat = array_ops.reshape(tensor, [(- 1)])
    i_flat = array_ops.reshape((array_ops.reshape((math_ops.range(0, shape[0]) * shape[1]), [(- 1), 1]) + indices), [(- 1)])
    return array_ops.reshape(array_ops.gather(p_flat, i_flat), [shape[0], (- 1)])
Returns columns from a 2-D tensor by index.
def _get_column_by_index(tensor, indices):
    
    shape = array_ops.shape(tensor)
    p_flat = array_ops.reshape(tensor, [(- 1)])
    i_flat = array_ops.reshape((array_ops.reshape((math_ops.range(0, shape[0]) * shape[1]), [(- 1), 1]) + indices), [(- 1)])
    return array_ops.reshape(array_ops.gather(p_flat, i_flat), [shape[0], (- 1)])