Comments (4)
Does op.Concat(zero, zero, padded_row, padded_col)
work for you?
from onnxscript.
Does
op.Concat(zero, zero, padded_row, padded_col)
work for you?
Thanks! Because these tensors are indeed scalars, so I have to unsqueeze them to 1D then concat, the following works. Not sure if this is a better way...
pads = op.Concat(op.Unsqueeze(zero, axes=[0]), op.Unsqueeze(zero, axes=[0]), op.Unsqueeze(pad_row, axes=[0]), op.Unsqueeze(pad_col, axes=[0]), axis = 0)
from onnxscript.
A naive question: how is this being run? I am a bit puzzled because this mixed-mode construction (interleaving script-time computation with onnx-construction) is doable in trace-mode, but not in script-mode.
Otherwise: nothing much to add to the existing discussion. If the shape is statically known, there may be other ways of doing this. But I assume you want to handle dynamic shapes here? So, Concat, as above, seems reasonable.
from onnxscript.
A naive question: how is this being run? I am a bit puzzled because this mixed-mode construction (interleaving script-time computation with onnx-construction) is doable in trace-mode, but not in script-mode.
Otherwise: nothing much to add to the existing discussion. If the shape is statically known, there may be other ways of doing this. But I assume you want to handle dynamic shapes here? So, Concat, as above, seems reasonable.
Sorry, i am not quite understand your comments... The script or trace modes are the ones in pytorch export?
If so, my context is different. The goal is not convert from pytorch, but directly write algorithm(not necessary deep learning model) in onnxscript. As shown inthis example, one step is to pad the image to the power of two. The shape of the input image is dynamic, but the shape of the pads is of course fixed as (4,).
from onnxscript.
Related Issues (20)
- [ONNX] Implement <OpOverload(op='aten.pixel_unshuffle', overload='default')>
- [torchlib] Implement <OpOverload(op='aten.repeat_interleave', overload='Tensor')>
- [torchlib] Implement <OpOverload(op='aten.scatter', overload='src')>
- [torchlib] Implement <OpOverload(op='aten.scatter', overload='value')>
- [torchlib] Implement <OpOverload(op='aten.silu', overload='default')>
- [torchlib] Implement <OpOverload(op='aten.sort', overload='default')>
- [torchlib] Implement <OpOverload(op='aten.std', overload='correction')>
- [torchlib] Implement <OpOverload(op='aten.std_mean', overload='correction')>
- [torchlib] Implement <OpOverload(op='aten.sym_size', overload='int')>
- [torchlib] Implement <OpOverload(op='aten.take', overload='default')>
- [torchlib] Implement <OpOverload(op='aten.unsafe_split', overload='Tensor')>
- [torchlib] Implement <OpOverload(op='torchvision.nms', overload='default')>
- [torchlib] Implement <OpOverload(op='torchvision.roi_align', overload='default')>
- [torchlib] Implement <OpOverload(op='torchvision.roi_pool', overload='default')>
- [exporter] Create a pass to turn tensors into external tensors HOT 1
- [core] Migrate OpSignature to ONNX Script
- [exporter] Create an IR modularization pass
- [exporter] Create an inliner pass for the IR
- [IR] Create a utility for merging models
- Use IR in the optimizer HOT 2
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 onnxscript.