GithubHelp home page GithubHelp logo

Comments (7)

bddppq avatar bddppq commented on May 21, 2024

For each data type the data can be stored in the corresponding data field (e.g. "FLOAT" -> float_data) or raw_data (except string, which can only be stored in "string_data" field). Storing it in raw_data field is for efficient protobuf parsing, see here: https://github.com/onnx/onnx/blob/master/onnx/numpy_helper.py#L46

from onnx.

ezyang avatar ezyang commented on May 21, 2024

The rule is that either raw_data is set, OR one of the other fields is set, appropriate for the type. @bddppq, do you know if the validator is testing for this? It's an error for multiple to be simultaneously set. Maybe we should have just gotten rid of the non-data fields.

In any case, float data will only ever be in float_data or raw_data, you don't have to test for ints.

from onnx.

bddppq avatar bddppq commented on May 21, 2024

I don't think there is any place checking this, we could check initializer in check_graph.

from onnx.

ezyang avatar ezyang commented on May 21, 2024

Yep; also we need to check it for tensor constants

from onnx.

linkerzhang avatar linkerzhang commented on May 21, 2024

Thanks! We may also come out of helper functions to parse the raw_data in this way. :).

from onnx.

ezyang avatar ezyang commented on May 21, 2024

Keeping this issue open to track validating tensor proto format.

from onnx.

ezyang avatar ezyang commented on May 21, 2024

Aaand fixed now :)

from onnx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.