class_docstr: ## 1D Convolution Compression $f_c$
  
  This is a simple wrapper around
  [`nn.Conv1d`](https://pytorch.org/docs/stable/generated/torch.nn.Conv1d.html)
  with some tensor dimension permutations.
docstr: `mem` has shape `[seq_len, batch, d_model]`
docstr_tok: ["`","mem","`","has","shape","`","[","seq_len",",","batch",",","d_model","]","`"]
code: def forward(self, mem: torch.Tensor):
      """
      `mem` has shape `[seq_len, batch, d_model]`
      """
  
      # Permute the dimensions of `mem` so that we can run it through the convolution layer.
      # The convolution layer accepts in the form `[batch, features, sequence]`
      mem = mem.permute(1, 2, 0)
      # Get compressed memory by running it through the convolution layer
      c_mem = self.conv(mem)
      # Permute back to form `[seq_len, batch, d_model]`
      return c_mem.permute(2, 0, 1)
  
imports: from typing import Optional, List
  import torch
  import torch.nn.functional
  from torch import nn
  from labml_helpers.module import Module, TypedModuleList
  from labml_nn.transformers.feed_forward import FeedForward
  from labml_nn.transformers.mha import PrepareForMultiHeadAttention
  from labml_nn.transformers.xl.relative_mha import RelativeMultiHeadAttention
  from labml_nn.utils import clone_module_list
label_desc: Use image node_id 2 for calling the Conv1dCompression obj's underlying member method code with example usage: obj.forward(mem) and returns: c_mem