code: def _fft2_helper(x, shape, axes):
      x = fft_input_validation(tf.convert_to_tensor(x))
      input_shape = x.shape
      input_rank_tensor = tf.rank(x)
  
      shape_, axes_ = shape_and_axes_validation(
          shape, axes, input_rank_tensor
      )
  
      axes = axes_initialization(
          shape, axes, input_shape, input_rank_tensor
      )
  
      (
          perform_padding,
          perform_transpose,
      ) = perform_actions_initialization(
          shape, axes, input_shape, input_rank_tensor
      )
  
      shape = shape_initialization(shape, axes, x)
  
      rank = rank_initialization(axes)
  
      x = get_x_after_pad_or_crop(
          x, shape, axes, perform_padding, input_rank_tensor
      )
  
      perm = get_perm(input_rank_tensor, axes)
  
      x = transpose_x(x, perm, perform_transpose)
  
      x = fft2_operations(x, rank)
  
      x = transpose_x(x, tf.argsort(perm), perform_transpose)
  
      x = tf.ensure_shape(
          x, static_output_shape(input_shape, shape_, axes_)
      )
  
      return x
  
imports: import math
  from typing import Union, Optional, Tuple, List, Literal, Sequence, Callable
  import tensorflow
  from ivy.func_wrapper import inputs_to_ivy_arrays, output_to_native_arrays, with_unsupported_dtypes, with_supported_dtypes, with_supported_device_and_dtypes
  from ..None import backend_version
  import ivy
  from ivy.functional.ivy.layers import _handle_padding, _get_num_padded_values, _validate_max_pool_params, _depth_max_pooling_helper
  from ivy.functional.ivy.experimental.layers import _padding_ceil_mode, _get_size
label_desc: Use image node_id 25 for calling a global function with example usage: _fft2_helper(x, shape, axes) and returns: x