(flatparams_P, output_shapes, name=None)
return outputs
Unflattens a vector produced by flatcat into a list of tensors of the specified shapes.
Unflattens a vector produced by flatcat into a list of tensors of the specified shapes.
Unflattens a vector produced by flatcat into a list of tensors of the specified shapes .
def unflatten_into_tensors(flatparams_P, output_shapes, name=None):
    '''
    Unflattens a vector produced by flatcat into a list of tensors of the specified shapes.
    '''
    outputs = []
    curr_pos = 0
    for shape in output_shapes:
        size = np.prod(shape)
        flatval = flatparams_P[curr_pos:curr_pos+size]
        outputs.append(flatval.reshape(shape))
        curr_pos += size
    # assert curr_pos == flatparams_P.get_shape().num_elements()
    return outputs
def unflatten_into_tensors ( flatparams_P , output_shapes , name = None ) : outputs = [ ] curr_pos = 0 for shape in output_shapes : size = np . prod ( shape ) flatval = flatparams_P [ curr_pos : curr_pos + size ] outputs . append ( flatval . reshape ( shape ) ) curr_pos += size # assert curr_pos == flatparams_P.get_shape().num_elements() return outputs