code: def ohem_batch(scores, gt_texts, training_masks):
      selected_masks = []
      for i in range(scores.shape[0]):
          selected_masks.append(
              ohem_single(
                  scores[i, :, :],
                  gt_texts[i, :, :],
                  training_masks[i, :, :],
              )
          )
  
      selected_masks = paddle.cast(
          paddle.concat(selected_masks, 0), "float32"
      )
      return selected_masks
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from paddle import nn
  import paddle.nn.functional
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: ohem_batch(scores, gt_texts, training_masks) and returns: selected_masks