def METHOD_NAME(net, val_dataset, cfg, save_dir):
    net.forward = paddle.jit.to_static(net.forward)
    input_shape = [1] + list(val_dataset[0]['img'].shape)
    input_var = paddle.ones(input_shape)
    out = net(input_var)
    save_path = os.path.join(save_dir, 'model')
    paddle.jit.save(net, save_path, input_spec=[input_var])
    yml_file = os.path.join(save_dir, 'deploy.yaml')
    with open(yml_file, 'w') as file:
        transforms = cfg.val_dataset_cfg['transforms']
        data = {
            'Deploy': {
                'transforms': transforms,
                'model': 'model.pdmodel',
                'params': 'model.pdiparams'
            }
        }
        yaml.dump(data, file)