class_docstr: Base class for speaker models.
class_docstr_tok: ["Base","class","for","speaker","models","."]
docstr: Logits layer to further produce softmax. 
docstr_tok: ["Logits","layer","to","further","produce","softmax","."]
code: def logits_layer(self, x, labels):
      """Logits layer to further produce softmax."""
      if labels is None:
          # serving export mode, no need for logits
          return x
  
      output_num = self.taskconf["classes"]["num"]
      logits_type = self.netconf["logits_type"]
      logits_shape = [x.shape[-1].value, output_num]
  
      with tf.variable_scope("logits"):
          init_type = self.netconf["logits_weight_init"]["type"]
          if init_type == "truncated_normal":
              stddev = self.netconf["logits_weight_init"]["stddev"]
              init = tf.truncated_normal_initializer(stddev=stddev)
          elif init_type == "xavier_uniform":
              init = tf.initializers.glorot_uniform()
          elif init_type == "xavier_norm":
              init = tf.initializers.glorot_normal()
          else:
              raise ValueError(
                  "Unsupported weight init type: %s" % (init_type)
              )
  
          weights = tf.get_variable(
              name="weights", shape=logits_shape, initializer=init
          )
  
          if logits_type == "linear":
              bias = tf.get_variable(
                  name="bias",
                  shape=logits_shape[1],
                  initializer=tf.constant_initializer(0.0),
              )
              return tf.matmul(x, weights) + bias
          elif logits_type == "linear_no_bias":
              return tf.matmul(x, weights)
          elif logits_type == "arcface":
              return self.arcface_layer(x, labels, output_num, weights)
  
imports: import math
  from absl import logging
  import delta.compat
  import tensorflow.keras.layers
  from delta import utils
  from delta.layers import common_layers
  from delta.models.base_model import RawModel
  from delta.utils.register import registers
  from delta.utils.loss.loss_utils import arcface_loss
  from delta.utils.hparam import HParams
label_desc: Use image node_id 10 for calling the SpeakerBaseRawModel obj's underlying member method code with example usage: obj.logits_layer(x, labels) and returns: x, unknown, tf, self