code: def _gates_to_load(gates):
      """Compute the true load per expert, given the gates.
  
      The load is the number of examples for which the corresponding gate is >0.
  
      Args:
        gates: a `Tensor` of shape [batch_size, n]
      Returns:
        a float32 `Tensor` of shape [n]
      """
      return tf.reduce_sum(tf.to_float(gates > 0), 0)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import math
  import six
  from six.moves import range
  from six.moves import zip
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers.vq_discrete import DiscreteBottleneck
  import tensorflow.compat.v1
label_desc: Use image node_id 9 for calling a global function with example usage: _gates_to_load(gates) and returns: tf