class_docstr: Global average pooling operation for spatial data.
  
  Arguments:
      data_format: A string,
          one of `channels_last` (default) or `channels_first`.
          The ordering of the dimensions in the inputs.
          `channels_last` corresponds to inputs with shape
          `(batch, height, width, channels)` while `channels_first`
          corresponds to inputs with shape
          `(batch, channels, height, width)`.
          It defaults to the `image_data_format` value found in your
          Keras config file at `~/.keras/keras.json`.
          If you never set it, then it will be "channels_last".
  
  Input shape:
      - If `data_format='channels_last'`:
          4D tensor with shape:
          `(batch_size, rows, cols, channels)`
      - If `data_format='channels_first'`:
          4D tensor with shape:
          `(batch_size, channels, rows, cols)`
  
  Output shape:
      2D tensor with shape:
      `(batch_size, channels)`
class_docstr_tok: ["Global","average","pooling","operation","for","spatial","data",".","Arguments",":","data_format",":","A","string",",","one","of","`","channels_last","`","(","default",")","or","`","channels_first","`",".","The","ordering","of","the","dimensions","in","the","inputs",".","`","channels_last","`","corresponds","to","inputs","with","shape","`","(","batch",",","height",",","width",",","channels",")","`","while","`","channels_first","`","corresponds","to","inputs","with","shape","`","(","batch",",","channels",",","height",",","width",")","`",".","It","defaults","to","the","`","image_data_format","`","value","found","in","your","Keras","config","file","at","`","~\/.keras\/keras.json","`",".","If","you","never","set","it",",","then","it","will","be","``","channels_last","''",".","Input","shape",":","-","If","`","data_format='channels_last","'","`",":","4D","tensor","with","shape",":","`","(","batch_size",",","rows",",","cols",",","channels",")","`","-","If","`","data_format='channels_first","'","`",":","4D","tensor","with","shape",":","`","(","batch_size",",","channels",",","rows",",","cols",")","`","Output","shape",":","2D","tensor","with","shape",":","`","(","batch_size",",","channels",")","`"]
code: def backward(self, d_y):
      x = self._layer_input
      if self.data_format == "channels_last":
          h_x, w_x = (x.shape[1], x.shape[2])
      else:
          h_x, w_x = (x.shape[2], x.shape[3])
  
      _d_y = d_y * self.scalar
      if not self.keepdims:
          _d_y = tfe.expand_dims(tfe.expand_dims(_d_y, axis=2), axis=3)
  
      d_x = tfe.tile(_d_y, multiples=[1, 1, h_x, w_x])
  
      if self.data_format == "channels_last":
          d_x = tfe.transpose(d_x, perm=[0, 2, 3, 1])
  
      return [], d_x
  
imports: import math
  from abc import abstractmethod
  from tensorflow.python.keras.utils import conv_utils
  import tf_encrypted
  from tf_encrypted.keras.engine import Layer
label_desc: Use image node_id 3 for calling the GlobalAveragePooling2D obj's underlying member method code with example usage: obj.backward(d_y) and returns: list,  d_x