tools#
Maths#
deeponnxcustom.tools.math_helper.apply_transitions
(n, transitions)
Applies a list of transitions (permutations of two elements) on the first n integers.
deeponnxcustom.tools.math_helper.decompose_permutation
(perm)
Decomposes a permutation into transitions.
ONNX#
deeponnxcustom.tools.onnx_helper.onnx_rename_weights
(onx)
Renames ONNX initialiers to make sure their name follows the alphabetical order. The model is modified inplace. This function calls
onnx_rename_names
.
deeponnxcustom.tools.onnx_helper.save_as_onnx
(model, filename, size = None, target_opset = 14, batch_size = 1, device = ‘cpu’, keep_initializers_as_inputs = False)
Converts a torch model into ONNX using
torch.onnx.export()
. The function works on models with only one input.