code: def unfold1d(
      x, kernel_size: int, padding_l: int, pad_value: float = 0
  ):
      """unfold T x B x C to T x B x C x K"""
      if kernel_size > 1:
          T, B, C = x.size()
          x = F.pad(
              x,
              (0, 0, 0, 0, padding_l, kernel_size - 1 - padding_l),
              value=pad_value,
          )
          x = x.as_strided((T, B, C, kernel_size), (B * C, C, 1, B * C))
      else:
          x = x.unsqueeze(3)
      return x
  
file_path: pytext/pytext/models/seq_models/utils.py
imports: import logging
  from typing import Dict, List, Optional
  import torch
  import torch.nn.functional
  from torch import nn, Tensor
label_desc: Use image node_id 4 for calling a global function with example usage: unfold1d(x, kernel_size, padding_l, pad_value) and returns: x