code: def forward(self, x, lengths=None):
      C, L = x.shape[1], x.shape[2]  # KP: (N, C, L)
  
      def _compute_statistics(x, m, axis=2, eps=self.eps):
          mean = (m * x).sum(axis)
          std = paddle.sqrt(
              (m * (x - mean.unsqueeze(axis)).pow(2))
              .sum(axis)
              .clip(eps)
          )
          return mean, std
  
      if lengths is None:
          lengths = paddle.ones([x.shape[0]])
  
      # Make binary mask of shape [N, 1, L]
      mask = length_to_mask(lengths * L, max_len=L)
      mask = mask.unsqueeze(1)
  
      # Expand the temporal context of the pooling layer by allowing the
      # self-attention to look at global properties of the utterance.
      if self.global_context:
          total = mask.sum(axis=2, keepdim=True).astype("float32")
          mean, std = _compute_statistics(x, mask / total)
          mean = mean.unsqueeze(2).tile((1, 1, L))
          std = std.unsqueeze(2).tile((1, 1, L))
          attn = paddle.concat([x, mean, std], axis=1)
      else:
          attn = x
  
      # Apply layers
      attn = self.conv(self.tanh(self.tdnn(attn)))
  
      # Filter out zero-paddings
      attn = paddle.where(
          mask.tile((1, C, 1)) == 0,
          paddle.ones_like(attn) * float("-inf"),
          attn,
      )
  
      attn = F.softmax(attn, axis=2)
      mean, std = _compute_statistics(x, attn)
  
      # Append mean and std of the batch
      pooled_stats = paddle.concat((mean, std), axis=1)
      pooled_stats = pooled_stats.unsqueeze(2)
  
      return pooled_stats
  
imports: import math
  import os
  import paddle
  import paddle.nn
  import paddle.nn.functional
label_desc: Use image node_id 2 for calling the AttentiveStatisticsPooling obj's underlying member method code with example usage: obj.forward(x, lengths) and returns: pooled_stats, mean,  std