code: def main():
      seg_num = 8
      target_size = 224
  
      video_files = [
          FLAGS.data + "/" + f for f in os.listdir(FLAGS.data)
      ]
      pipeline = create_video_pipe(
          video_files, seg_num, target_size, FLAGS.stride
      )
  
      video_loader = DALIGenericIterator(
          pipeline, ["image"], reader_name="Reader", dynamic_shape=True
      )
  
      exe = static.Executor(paddle.CUDAPlace(0))
      startup_prog = static.Program()
      eval_prog = static.Program()
  
      with static.program_guard(eval_prog, startup_prog):
          with paddle.utils.unique_name.guard():
              fetch_list = build(seg_num, target_size)
  
      exe.run(startup_prog)
      compiled_eval_prog = static.CompiledProgram(eval_prog)
  
      load_weights(exe, eval_prog, PRETRAIN_WEIGHTS)
  
      labels = json.load(open("kinetics_labels.json"))
  
      for idx, batch in enumerate(video_loader):
          fetches = exe.run(
              compiled_eval_prog, feed=batch, fetch_list=fetch_list
          )
          pred = fetches[0][0]
          topk_indices = pred.argsort()[0 - FLAGS.topk :]
          topk_labels = [labels[i] for i in topk_indices]
          filename = video_files[idx]
          print(
              "prediction for {} is: {}".format(filename, topk_labels)
          )
  
file_path: DALI/docs/examples/use_cases/paddle/tsm/infer.py
imports: import argparse
  import json
  import os
  import paddle
  import paddle.static
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.types
  import nvidia.dali.fn
  from nvidia.dali.plugin.paddle import DALIGenericIterator
  from tsm import TSM
  from utils import load_weights
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types