<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_graph(self):
 """Build a whole graph for the model."""

        self.global_step = tf.Variable(0, trainable=False)
        self._build_model()
        if self.mode == "train":
            self._build_train_op()
        else:
            # Additional initialization for the test network.
            self.variables = ray.experimental.tf_utils.TensorFlowVariables(
                self.cost)
            self.summaries = tf.summary.merge_all()