class_docstr: Tests for FractionalMaxPoolGrad.
  
  Two types of tests for FractionalMaxPoolGrad.
  1) Test fractional_max_pool_grad() directly.
    This type of test relies on gen_nn_ops.max_pool_grad() returns the correct
  result. For example:
    * input_tensor_shape = (1, 10, 10, 1)
    * window_size = (1, 2, 2, 1)
    * stride_size = (1, 2, 2, 1)
    * padding: not really import, since 10/2 is divisible
  max pooling should generate the same result as fractional max pooling with:
    * row_sequence = [0, 2, 4, 6, 8, 10]
    * col_sequence = [0, 2, 4, 6, 8, 10]
    * overlapping = False
  This also means their gradients in such case will be the same.
  
    Similarly, when
    * input_tensor_shape = (1, 7, 7, 1)
    * window_size = (1, 3, 3, 1)
    * stride_size = (1, 2, 2, 1)
    * padding: not important
  max pooling should generate the same result as fractional max pooling with:
    * row_sequence = [0, 2, 4, 7]
    * col_sequence = [0, 2, 4, 7]
    * overlapping = True
  2) Test through compute_gradient_error()
code: def testDirectUseOverlapping(self):
      for num_batches in [1, 3]:
          for row_window_size in [2, 5]:
              for col_window_size in [2, 4]:
                  num_rows = (row_window_size - 1) * 5 + 1
                  num_cols = (col_window_size - 1) * 7 + 1
                  for num_channels in [1, 2]:
                      input_shape = (
                          num_batches,
                          num_rows,
                          num_cols,
                          num_channels,
                      )
                      with self.cached_session() as _:
                          input_tensor = constant_op.constant(
                              self._GenerateUniqueRandomInputTensor(
                                  input_shape
                              )
                          )
                          window_size = [
                              1,
                              row_window_size,
                              col_window_size,
                              1,
                          ]
                          stride_size = [
                              1,
                              row_window_size - 1,
                              col_window_size - 1,
                              1,
                          ]
                          padding = "VALID"
                          output_tensor = nn_ops.max_pool(
                              input_tensor,
                              window_size,
                              stride_size,
                              padding,
                          )
                          output_data = self.evaluate(output_tensor)
                          output_backprop = self._PRNG.randint(
                              100, size=output_data.shape
                          )
                          input_backprop_tensor = (
                              gen_nn_ops.max_pool_grad(
                                  input_tensor,
                                  output_tensor,
                                  output_backprop,
                                  window_size,
                                  stride_size,
                                  padding,
                              )
                          )
                          input_backprop = self.evaluate(
                              input_backprop_tensor
                          )
                          row_seq = list(
                              range(0, num_rows, row_window_size - 1)
                          )
                          col_seq = list(
                              range(0, num_cols, col_window_size - 1)
                          )
                          row_seq[-1] += 1
                          col_seq[-1] += 1
                          fmp_input_backprop_tensor = (
                              gen_nn_ops.fractional_max_pool_grad(
                                  input_tensor,
                                  output_tensor,
                                  output_backprop,
                                  row_seq,
                                  col_seq,
                                  overlapping=True,
                              )
                          )
                          fmp_input_backprop = self.evaluate(
                              fmp_input_backprop_tensor
                          )
                          self.assertShapeEqual(
                              input_backprop, fmp_input_backprop_tensor
                          )
                          self.assertAllClose(
                              input_backprop, fmp_input_backprop
                          )
  
imports: import math
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import nn_ops
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the FractionalMaxPoolGradTest obj's underlying member method code with example usage: obj.testDirectUseOverlapping() without return types