Build a whole graph for the model.

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()