ARModel: make interface use FluidTensorView #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
As discussed, updating interface of
ARModel
to useFluidTensorView
rather than raw pointers, so that the sizes and offsets of the views could make it slightly easier to express / follow intentions w/r/t reading before pointers etc.Bits of this you may find aesthetically objectionable. I've buggered about more with the little family of
[model | forward | backward] [Error | Predict]()
methods than originally imagined.modelPredict
, which gets passed a different function object depending on whether it's doing a prediction or reporting an error. It probably warrants renaming.Personally, I'm happy that this is improvement in terms of readability and reason-about-ness, but then I'm (obviously) very comfortable with reading code with
FluidTensorView
manipulations in it. I do like that we need to be explicit about offsets and sizes at call sites, and that it's possible to drop assertions in pretty much throughout the call stack to ensure that assumptions about data before and after specific pointer locations are true.After some false starts, it also passes the same (pretty lightweight) tests as the previous commit. (C++ equivalent tests still need updating...)