    def _compile_outputs(self, inputs, ret_log_var=False):
        """Compiles the output of the network at the given inputs.

        If inputs is 2D, returns a 3D tensor where output[i] is the output of the ith network in the ensemble.
        If inputs is 3D, returns a 3D tensor where output[i] is the output of the ith network on the ith input matrix.

        Arguments:
            inputs: (tf.Tensor) A tensor representing the inputs to the network
            ret_log_var: (bool) If True, returns the log variance instead of the variance.

        Returns: (tf.Tensors) The mean and variance/log variance predictions at inputs for each network
            in the ensemble.
        """
        dim_output = self.layers[-1].get_output_dim()
        cur_out = self.scaler.transform(inputs)
        for layer in self.layers:
            cur_out = layer.compute_output_tensor(cur_out)

        mean = cur_out[:, :, :dim_output//2]
        if self.end_act is not None:
            mean = self.end_act(mean)

        logvar = self.max_logvar - tf.nn.softplus(self.max_logvar - cur_out[:, :, dim_output//2:])
        logvar = self.min_logvar + tf.nn.softplus(logvar - self.min_logvar)

        if ret_log_var:
            return mean, logvar
        else:
            return mean, tf.exp(logvar)
Compiles the output of the network at the given inputs.

If inputs is 2D, returns a 3D tensor where output[i] is the output of the ith network in the ensemble.
If inputs is 3D, returns a 3D tensor where output[i] is the output of the ith network on the ith input matrix.

Arguments:
inputs: (tf.Tensor) A tensor representing the inputs to the network
ret_log_var: (bool) If True, returns the log variance instead of the variance.

Returns: (tf.Tensors) The mean and variance/log variance predictions at inputs for each network
in the ensemble.
mbpo/models/bnn.py