code: def test_reduce_front_max_with_length(self, dc, gc):
      num_reduce_dim = 1
      X = np.random.rand(2, 3, 4, 5).astype(np.float32)
      batch_size = int(np.prod([2, 3, 4, 5][num_reduce_dim:]))
      d = 120 // batch_size
      lengths = np.random.randint(1, d, size=batch_size).astype(
          np.int32
      )
  
      def ref_max(X, lengths):
          Y = X.reshape(d, lengths.size)
          rv = np.zeros((lengths.size, 1)).astype(np.float32)
          for ii in range(lengths.size):
              rv[ii] = np.max(Y[: lengths[ii], ii])
          return [rv.reshape((2, 3, 4, 5)[num_reduce_dim:])]
  
      self.max_op_test(
          "ReduceFrontMax",
          num_reduce_dim,
          gc,
          dc,
          [X, lengths],
          ["X", "lengths"],
          ref_max,
      )
  
imports: from caffe2.python import core, workspace
  from hypothesis import given, settings
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
  import hypothesis.strategies
  import numpy
  import itertools
label_desc: Use image node_id 10 for calling the TestReduceFrontReductions obj's underlying member method code with example usage: obj.test_reduce_front_max_with_length(dc, gc) and returns: list