code: def c3d_kinetics400(
      nclass=400,
      pretrained=False,
      ctx=cpu(),
      root="~/.mxnet/models",
      num_segments=1,
      num_crop=1,
      feat_ext=False,
      **kwargs,
  ):
      r"""The Convolutional 3D network (C3D) trained on Kinetics400 dataset.
      Learning Spatiotemporal Features with 3D Convolutional Networks.
      ICCV, 2015. https://arxiv.org/abs/1412.0767
  
      Parameters
      ----------
      nclass : int.
          Number of categories in the dataset.
      pretrained : bool or str.
          Boolean value controls whether to load the default pretrained weights for model.
          String value represents the hashtag for a certain version of pretrained weights.
      ctx : Context, default CPU.
          The context in which to load the pretrained weights.
      root : str, default $MXNET_HOME/models
          Location for keeping the model parameters.
      num_segments : int, default is 1.
          Number of segments used to evenly divide a video.
      num_crop : int, default is 1.
          Number of crops used during evaluation, choices are 1, 3 or 10.
      feat_ext : bool.
          Whether to extract features before dense classification layer or
          do a complete forward pass.
      """
  
      model = C3D(
          nclass=nclass,
          ctx=ctx,
          num_segments=num_segments,
          num_crop=num_crop,
          feat_ext=feat_ext,
          **kwargs,
      )
      model.initialize(init.MSRAPrelu(), ctx=ctx)
  
      if pretrained:
          from ..model_store import get_model_file
  
          model.load_parameters(
              get_model_file(
                  "c3d_kinetics400", tag=pretrained, root=root
              ),
              ctx=ctx,
          )
          from ...data import Kinetics400Attr
  
          attrib = Kinetics400Attr()
          model.classes = attrib.classes
      model.collect_params().reset_ctx(ctx)
  
      return model
  
file_path: gluon-cv/gluoncv/model_zoo/action_recognition/c3d.py
imports: from mxnet import init
  from mxnet.context import cpu
  from mxnet.gluon.block import HybridBlock
  from mxnet.gluon import nn
label_desc: Use image node_id 1 for calling a global function with example usage: c3d_kinetics400(nclass, pretrained, ctx, root, num_segments, num_crop, feat_ext) and returns: model