Comments (3)
I don't think this is a pattern we should encourage. You should instead do:
nn.Sequential([
m1,
m2,
])
If you need something dynamic:
a = [m1]
a += [m2]
nn.Sequential(a)
Chaining methods in general is a lot less nice in Python than Lua because they don't break cleanly across lines. You have to surround it with parentheses or break lines with \
from pytorch.
+1
from pytorch.
I didn't realize that this constructor existed.
from pytorch.
Related Issues (20)
- PRs with unbalanced quotes can not be merged
- torch.onnx.export generates an incorrect bias shape for certain conv transpose models
- `ascii` error during recompilation after cache limit is reached (likely due to `einsum`) HOT 2
- Give the possibly to get back normal `Tensor`s as `MaskedTensor` gradients
- torch dynamo's ORT backend uses "ort" dispatch key instead of "maia"
- Export llama v3 to ONNX HOT 1
- [Releng] Triton version for minor releases starting with 2.4
- [MPS] `torch.nextafter` incorrect handling of negative inputs
- [DTensor] Keep track of data-dependent ops and skip _propagate_tensor_meta to go thru fake tensor
- [DTensor] Sharding strategy not implemented error should be thrown earlier
- h HOT 1
- use bfloat16 on nvidia V100 GPU HOT 1
- When I set the operator weights all to 1, the operator weights change as soon as an input is made to the operator
- bool as scalar in jit ir API not working as expected.
- RuntimeError: Unsupported qscheme: per_channel_affine. When using quantise_fx(
- Support exporting the compute graph JiT compiled by inductor?
- Tensor can not be accessed!
- How can i train my model with torchrun on multiple GPUs but without DDP?
- libtorch C++ windows: The specified module could not be found. mkl_vml_def.1.dll
- Accessing the `device` attribute of bias terms of `TransformerEncoderLayer` initialized with `bias = False` causes Attribute error 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 pytorch.