def fixed_inputs(model, non_fixed_inputs, fix_routine='<STR_LIT>', as_list=True, X_all=False):
from ...inference.latent_function_inference.posterior import VariationalPosterior<EOL>f_inputs = []<EOL>if hasattr(model, '<STR_LIT>') and model.has_uncertain_inputs():<EOL><INDENT>X = model.X.mean.values.copy()<EOL><DEDENT>elif isinstance(model.X, VariationalPosterior):<EOL><INDENT>X = model.X.values.copy()<EOL><DEDENT>else:<EOL><INDENT>if X_all:<EOL><INDENT>X = model.X_all.copy()<EOL><DEDENT>else:<EOL><INDENT>X = model.X.copy()<EOL><DEDENT><DEDENT>for i in range(X.shape[<NUM_LIT:1>]):<EOL><INDENT>if i not in non_fixed_inputs:<EOL><INDENT>if fix_routine == '<STR_LIT>':<EOL><INDENT>f_inputs.append( (i, np.mean(X[:,i])) )<EOL><DEDENT>if fix_routine == '<STR_LIT>':<EOL><INDENT>f_inputs.append( (i, np.median(X[:,i])) )<EOL><DEDENT>else: <EOL><INDENT>f_inputs.append( (i, <NUM_LIT:0>) )<EOL><DEDENT>if not as_list:<EOL><INDENT>X[:,i] = f_inputs[-<NUM_LIT:1>][<NUM_LIT:1>]<EOL><DEDENT><DEDENT><DEDENT>if as_list:<EOL><INDENT>return f_inputs<EOL><DEDENT>else:<EOL><INDENT>return X<EOL><DEDENT>
Convenience function for returning back fixed_inputs where the other inputs
are fixed using fix_routine
:param model: model
:type model: Model
:param non_fixed_inputs: dimensions of non fixed inputs
:type non_fixed_inputs: list
:param fix_routine: fixing routine to use, 'mean', 'median', 'zero'
:type fix_routine: string
:param as_list: if true, will return a list of tuples with (dimension, fixed_val) otherwise it will create the corresponding X matrix
:type as_list: boolean