Comments (1)
This is just failing to keep dict
alive in the captured function I think. The error isn't helpful but the use case isn't currently supported.
This works:
fn main():
var dict = Dict[Int, Int]()
@parameter
fn f():
dict = Dict[Int, Int]()
var build_stats = benchmark.run[f](max_runtime_secs=0.5)
build_stats.print_full()
_ = dict
and so does this:
fn main() raises:
var dict = Dict[Int, Int]()
_ = dict^
dict = Dict[Int, Int]()
dict[1] = 1
print(dict[1])
from mojo.
Related Issues (20)
- [Modular CLI] install modular command tool without require root permissions HOT 4
- [BUG] crash when first trying to debug a mojo app in VSCode using WSL VS Code Server: "free(): invalid pointer" HOT 1
- [Feature Request] Merge `init_pointee_move` and `move_pointee_into`. HOT 5
- [BUG] trouble reading a file HOT 3
- Implicit conversions between SIMD values can lose data HOT 3
- [Feature Request] A `Type[AnyStruct | AnyClass | etc]` operator that returns the type's interface (as a trait)
- [BUG] Sneaky ternary operator bugs
- [BUG] Improve error message when adding parameters to runtime function
- [BUG] Values get set to 1 when passing one Scalar into another Scalar's constructor HOT 5
- [BUG] crash when passing offset DTypePointer into Tensor
- [BUG] Unsigned integer casting overflowing as if signed when using `int()` or `UInt32()` HOT 13
- [BUG] modular: error: failed to run script HOT 3
- Implement arithmetic operators for `UInt`
- [BUG] math/numeric functions weird behavior with float16 types HOT 6
- [BUG] question about writing to file HOT 5
- [BUG] Cannot materialize a capturing closure
- [Docs] the "random" module should not be imported by default HOT 2
- [BUG] Index out of bound with nested list literals HOT 1
- [Feature Request] Allow __getitem__ calls to use a mix of colon slices and integers
- [BUG] Program Crash on generating simple data. 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 mojo.