Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for registring custom op libraries #68

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Feb 24, 2021

  1. Introduce a new trait to represent types that can be used as output f…

    …rom a tensor
    
    This is some prep work for string output types and tensor types that vary across the model outputs. For now, the supported types are just the basic numeric types.
    
    Since strings have to be copied out of a tensor, it only makes sense to have `String` be an output type, not `str`, hence the new type so that we can have more input types supported than output types.
    marshallpierce committed Feb 24, 2021
    Configuration menu
    Copy the full SHA
    0d34d23 View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2021

  1. Use DynOrtTensor for model output tensors

    Outputs aren't all the same type for a single model, so this allows extracting different types per tensor.
    marshallpierce committed Feb 26, 2021
    Configuration menu
    Copy the full SHA
    555bec7 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2021

  1. Support the onnx string type in output tensors

    This approach allocates owned Strings for each element, which works, but stresses the allocator, and incurs unnecessary copying.
    
    Part of the complication stems from the limitation that in Rust, a field can't be a reference to another field in the same struct. This means that having a Vec<u8> of copied data, referred to by a Vec<&str>, which is then referred to by an ArrayView, requires a sequence of 3 structs to express. Building a Vec<String> gets rid of the references, but also loses the efficiency of 1 allocation with strs pointing into it.
    marshallpierce committed Mar 9, 2021
    Configuration menu
    Copy the full SHA
    d2f1ebe View commit details
    Browse the repository at this point in the history
  2. Support the onnx string type in output tensors

    This approach allocates owned Strings for each element, which works, but stresses the allocator, and incurs unnecessary copying.
    
    Part of the complication stems from the limitation that in Rust, a field can't be a reference to another field in the same struct. This means that having a Vec<u8> of copied data, referred to by a Vec<&str>, which is then referred to by an ArrayView, requires a sequence of 3 structs to express. Building a Vec<String> gets rid of the references, but also loses the efficiency of 1 allocation with strs pointing into it.
    marshallpierce committed Mar 9, 2021
    Configuration menu
    Copy the full SHA
    495ecb4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6cf6d0e View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2021

  1. Remove stray

    marshallpierce committed Mar 10, 2021
    Configuration menu
    Copy the full SHA
    457012b View commit details
    Browse the repository at this point in the history