Conversation
| save_data_and_model("split_2", input, model) | ||
|
|
||
| model = Split(0) | ||
| save_data_and_model("split_3", input, model) |
There was a problem hiding this comment.
What's the difference between split_1 and split_3 cases?
There was a problem hiding this comment.
I was trying to tests how the model will be processed by ONNXImporter in case no attribute is given to Split in split_1. In split_3, I am trying to test the case when only axis is given. I think one more case is left, when only split is given. I will add that too.
|
Update: |
ab707ee to
5acfb8e
Compare
| def forward(self, x): | ||
| tup = torch.split(x, self.split_size_sections, self.dim) | ||
| return torch.cat(tup) |
There was a problem hiding this comment.
I have used this because, usually, torch.split returns a python tuple which if converted to a tensor here will render the code useless as the layer will be saved as Constant and not Split.
And we cannot save python tuple in npy file as they are not produced correctly in the cpp tests and moreover they will require a lot of changes across some files to make tuples work in the code. Hence, this trick tests the Split layer with minimal changes in the code. Though I am open to suggestions on improving this.
There was a problem hiding this comment.
I have run the tests locally they, pass on my system.
|
The tests passed. Is it good to go? |
See, opencv/opencv#16424 (comment)
ping @dkurt Please take a look. Please let me know if there is any change to make.