Comments (3)
therefore resolving can only happen after a previous operator has been executed.
Not sure what you mean by this.
Yes, this is something that we have to fix. Our current implementation is hardcoded to float.
// inference.c
...
all_context[nodeIdx].outputs[i]->data_type = 1;
...
So I imagine that the "initialisation" function that you are referring to is a function that populates this data_type
for a given operator, right? Or what do you mean by "initializes its outputs"?
Someway related to #40, we have to think a way to know the output data_type
for each operator. I haven't deeply looked into it but I had in mind some kind of generic function, and treat the specific cases aside. Some come cases from the top of my mind:
- If the operator has only 1 input and 1 output. Output
data_type
is the same as the input one (with some exceptions ofc) - If there are two inputs, take the
data_type
of the first one. - Treat aside specific cases such as Cast, Constant,...
from connxr.
In order to run an operator, all its inputs must be allocated (i.e. data field, not the tensor itself), have a set datatype/shape/... attribute and be filled with data.
Currently the executer does all of these things at once, I would like to split these things up.
As far as I see it, the allocation and setting of datatype/shape/... can be done before any calculation.
So we could split up these parts into two functions, one that does the actual calculation and one that does all the other stuff needed beforehand.
Someway related to #40, we have to think a way to know the output
data_type
for each operator. I haven't deeply looked into it but I had in mind some kind of generic function, and treat the specific cases aside. Some come cases from the top of my mind:
At least for things like the shape attribute, I don't think a generic approach is possible. Would be great, but I don't see it.
from connxr.
Sounds good. I wasn't thinking about the shape but can help to remove repeated code. Some operators like Conv
need quite a lot of code to calculate the output shape, and with the current implementation we have to run this calculations for every type (float, double). This idea might help with that also.
from connxr.
Related Issues (20)
- How to convert the model input to a .pb file?
- Two missing null check for return values of searchAttributeNyName()
- Help running inference using yolov5, 6 & 8 HOT 4
- remove/integrate old trace.{c,h} into tracing.h
- Add C++ ifdef inside header to disable mangling
- Github action windows build fails
- Wrong printf format string for type int32_t
- Support for hardware without file systems HOT 2
- Memory leaks HOT 4
- Add support for ConvTranspose2d
- Tracing not compatible with C99 HOT 4
- Benchmarking and time.h on Windows
- cannot find -lcunit HOT 2
- build fail on linux and mac HOT 5
- tiny yolov2 doesn't work on raspberry pi zero HOT 9
- src/inference.c line 29 HOT 1
- using macro function to reduce execute_operator_***.c file to single c source file HOT 1
- modify src/inference.c file target to resolve once and not depend on inputs HOT 1
- Add operator can be write in macro without type HOT 1
- example use other input HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connxr.