code: def build_linear_regressor(
      self, weight, weight_shape, bias, bias_shape
  ):
      with tf.Graph().as_default():
          # Use a partitioner that is known a priori because canned Estimators
          # default to using one otherwise. This allows tests to access variables
          # used in the underlying Estimator.
          tf.get_variable(
              name=WEIGHT_VARIABLE,
              shape=weight_shape,
              initializer=weight,
              partitioner=tf.fixed_size_partitioner(1),
          )
          tf.get_variable(
              name=BIAS_VARIABLE,
              shape=bias_shape,
              initializer=bias,
              partitioner=tf.fixed_size_partitioner(1),
          )
          tf.Variable(
              100, name=tf.GraphKeys.GLOBAL_STEP, dtype=tf.int64
          )
  
          with tf.Session() as sess:
              sess.run([tf.global_variables_initializer()])
              tf.train.Saver().save(
                  sess, os.path.join(self.model_dir, "model.ckpt")
              )
  
      fc = tf.feature_column.numeric_column(
          FEATURE_NAME, shape=np.array(weight).shape
      )
      return tf_estimator.LinearRegressor(
          feature_columns=(fc,),
          model_dir=self.model_dir,
          optimizer="SGD",
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import shutil
  import tempfile
  import neural_structured_learning.configs
  import neural_structured_learning.estimator
  import numpy
  import tensorflow
  from tensorflow import estimator
  from google.protobuf import text_format
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 3 for calling the GraphRegularizationTest obj's underlying member method code with example usage: obj.build_linear_regressor(weight, weight_shape, bias, bias_shape) and returns: tf_estimator