code: def channel_shuffle(x: Tensor, groups: int) -> Tensor:
      batchsize, num_channels, height, width = x.size()
      channels_per_group = num_channels // groups
  
      # reshape
      x = x.view(batchsize, groups, channels_per_group, height, width)
  
      x = torch.transpose(x, 1, 2).contiguous()
  
      # flatten
      x = x.view(batchsize, num_channels, height, width)
  
      return x
  
imports: from functools import partial
  from typing import Any, Callable, List, Optional
  import torch
  import torch.nn
  from torch import Tensor
  from ..transforms._presets import ImageClassification
  from ..utils import _log_api_usage_once
  from ._api import register_model, Weights, WeightsEnum
  from ._meta import _IMAGENET_CATEGORIES
  from ._utils import _ovewrite_named_param, handle_legacy_interface
label_desc: Use image node_id 1 for calling a global function with example usage: channel_shuffle(x, groups) and returns: x