null
null
MModular
Created by null on 7/10/2024 in #questions
How to initialize a tensor[DType.int8] with random values of either: -1, 0, or 1?
Ah, got it. a.unsafe_ptr() not a._take_data_ptr(). My intellisense betrayed me!
16 replies
MModular
Created by null on 7/10/2024 in #questions
How to initialize a tensor[DType.int8] with random values of either: -1, 0, or 1?
"number of elements to fill", I assume that is 100. so: randintDType.int8, 100, -1, 1) then when I try and print:
[3914:3914:20240711,145433.691824:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[3914:3914:20240711,145433.691868:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0. Program arguments: mojo test.mojo
#0 0x0000556167ca6438 (/home/pat/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x12a1438)
#1 0x0000556167ca425e (/home/pat/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x129f25e)
#2 0x0000556167ca6acd (/home/pat/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x12a1acd)
#3 0x00007f04855b9320 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
#4 0x00007f040000b85e
mojo crashed!
Please file a bug report.
[1] 3912 segmentation fault mojo test.mojo
[3914:3914:20240711,145433.691824:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[3914:3914:20240711,145433.691868:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0. Program arguments: mojo test.mojo
#0 0x0000556167ca6438 (/home/pat/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x12a1438)
#1 0x0000556167ca425e (/home/pat/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x129f25e)
#2 0x0000556167ca6acd (/home/pat/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x12a1acd)
#3 0x00007f04855b9320 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
#4 0x00007f040000b85e
mojo crashed!
Please file a bug report.
[1] 3912 segmentation fault mojo test.mojo
16 replies
MModular
Created by null on 7/10/2024 in #questions
How to initialize a tensor[DType.int8] with random values of either: -1, 0, or 1?
Actually, maybe that's right? It explodes when I try and print a though.
16 replies
MModular
Created by null on 7/10/2024 in #questions
How to initialize a tensor[DType.int8] with random values of either: -1, 0, or 1?
err, not 1..
16 replies
MModular
Created by null on 7/10/2024 in #questions
How to initialize a tensor[DType.int8] with random values of either: -1, 0, or 1?
Like this?
var a = Tensor[DType.int8](100)
randint[DType.int8](a._take_data_ptr(), 1, -1, 1)
var a = Tensor[DType.int8](100)
randint[DType.int8](a._take_data_ptr(), 1, -1, 1)
16 replies
MModular
Created by null on 7/10/2024 in #questions
How to initialize a tensor[DType.int8] with random values of either: -1, 0, or 1?
Point being, I need a way to randomly initialize really large vectors (could be a million dimensions for example)
16 replies
MModular
Created by null on 7/10/2024 in #questions
How to initialize a tensor[DType.int8] with random values of either: -1, 0, or 1?
@benny Playing with hyperdimensional vectors, requires vectors with dimensions over 10,000 to be useful (this is a rule in Vector Symbolic Architecture). For example: https://torchhd.readthedocs.io/en/stable/generated/torchhd.random.html#torchhd.random Except I want to experiment with 3 valued systems rather than two. But anyway, to create a VSA you need operations like element wise multiplication, addition, and other operations (element wise XOR, etc, for the BSC architecture)
16 replies