docstr: Calculate the Gumbel with maximum.
  
  Parameters
  ----------
  phi : mx.np.ndarray
      Shape (batch_size, beam_size, L).
  T : mx.np.ndarray
      The previous scores. Shape (batch_size, beam_size)
docstr_tok: ["Calculate","the","Gumbel","with","maximum",".","Parameters","--","--","--","--","--","phi",":","mx.np.ndarray","Shape","(","batch_size",",","beam_size",",","L",")",".","T",":","mx.np.ndarray","The","previous","scores",".","Shape","(","batch_size",",","beam_size",")"]
code: def gumbel_with_maximum(self, phi, T, dim=-1):
      """Calculate the Gumbel with maximum.
  
      Parameters
      ----------
      phi : mx.np.ndarray
          Shape (batch_size, beam_size, L).
      T : mx.np.ndarray
          The previous scores. Shape (batch_size, beam_size)
      """
      g_phi = phi + mx.np.random.gumbel(mx.np.zeros_like(phi))
      Z = g_phi.max(dim)
      g = self.shift_gumbel_maximum(g_phi, T, dim, Z=Z)
      return g
  
imports: import warnings
  import mxnet
  import abc
  from mxnet.gluon import HybridBlock
  from typing import Callable, Optional
  from .layers import get_activation
label_desc: Use image node_id 2 for calling the _BeamSearchStepUpdate obj's underlying member method code with example usage: obj.gumbel_with_maximum(phi, T, dim) and returns: g