AlexanderLutsenko / nobuco

Pytorch to Keras/Tensorflow/TFLite conversion made intuitive
MIT License
272 stars 17 forks source link

Added unittest setup with a unittest #42

Open crimson206 opened 6 months ago

crimson206 commented 6 months ago

Motivation

It is hard to prove the validation of contributed converter implementations without unit tests.

Added Setup

Unittest Design

A single torch operator is wrapped as a module, and tested by nobuco.pytorch_to_keras. The following are tested.

Message to the Project Owner

  1. Although I have recently implemented the converters for torch.sign and torch.Tensor.__getattribute__, I didn't include unittests for them in this branch. It is in order to isolate this PR more properly.

  2. Even if you don't agree with the setup or the design or the unittest, I hope you to merge it first, and then you update them later for the following reasons,

    • It functions well anyway. Use it at least as a temporary measure, and upgrade later.
    • You don't need to verify the contributed converters by yourself.
    • It helps the contributors.
  3. If you merge this branch, it would be nice to add Contribution.md in order to encourage contributors the self-validation.