onnx_chainer.export_testcase

onnx_chainer.export_testcase(model, args, out_dir, output_grad=False, **kwargs)

Export model and I/O tensors of the model in protobuf format.

Similar to the export function, this function first performs a forward computation to a given input for obtaining an output. Then, this function saves the pair of input and output in Protobuf format, which is a defacto-standard format in ONNX.

This function also saves the model with the name “model.onnx”.

Parameters
  • model (Chain) – The model object.

  • args (list) – The arguments which are given to the model directly. Unlike export function, only list type is accepted.

  • out_dir (str) – The directory name used for saving the input and output.

  • output_grad (bool) – If True, this function will output model’s gradient with names ‘gradient_%d.pb’.

  • **kwargs (dict) – keyword arguments for onnx_chainer.export.