(self, discretization, vertex_values, project=False,
                 name='triangulation')
Initialization.
Initialization.
Initialization .
def __init__(self, discretization, vertex_values, project=False,
                 name='triangulation'):
        """Initialization."""
        super(Triangulation, self).__init__(name=name)

        with tf.variable_scope(self.scope_name):
            self.tri = _Triangulation(discretization,
                                      project=project)

            # Make sure the variable has the correct size
            if not isinstance(vertex_values, tf.Variable):
                self.tri.parameters = vertex_values
                vertex_values = self.tri.parameters.astype(config.np_dtype)
            vertex_values = tf.Variable(vertex_values,
                                        name='vertex_values')

            # Initialize parameters
            sess = tf.get_default_session()
            if sess is not None:
                init = tf.variables_initializer(self.parameters)
                tf.get_default_session().run(init)

            self.input_dim = self.tri.input_dim
            self.output_dim = self.tri.output_dim
def __init__ ( self , discretization , vertex_values , project = False , name = 'triangulation' ) : super ( Triangulation , self ) . __init__ ( name = name ) with tf . variable_scope ( self . scope_name ) : self . tri = _Triangulation ( discretization , project = project ) # Make sure the variable has the correct size if not isinstance ( vertex_values , tf . Variable ) : self . tri . parameters = vertex_values vertex_values = self . tri . parameters . astype ( config . np_dtype ) vertex_values = tf . Variable ( vertex_values , name = 'vertex_values' ) # Initialize parameters sess = tf . get_default_session ( ) if sess is not None : init = tf . variables_initializer ( self . parameters ) tf . get_default_session ( ) . run ( init ) self . input_dim = self . tri . input_dim self . output_dim = self . tri . output_dim