DJ_HalfcourtViolation
DJ_HalfcourtViolation
MModular
Created by DJ_HalfcourtViolation on 5/12/2024 in #questions
Assigning slice of a tensor to a variable?
In the meantime how would you suggest getting slices for multiple variables? Something like
fn blah():
var t = Tensor[DType.float64](
(3, 1),
-1,
0,
1,
0
)
var x: Tensor[DType.float64] = Tensor[DType.float64](2, 1)
var y: Tensor[DType.float64] = Tensor[DType.float64](2, 1)
for i in range(4):
if i < 2:
x[i] = t[i, 0]
else:
y[i] = t[i, 0]
print(x)
fn blah():
var t = Tensor[DType.float64](
(3, 1),
-1,
0,
1,
0
)
var x: Tensor[DType.float64] = Tensor[DType.float64](2, 1)
var y: Tensor[DType.float64] = Tensor[DType.float64](2, 1)
for i in range(4):
if i < 2:
x[i] = t[i, 0]
else:
y[i] = t[i, 0]
print(x)
7 replies
MModular
Created by DJ_HalfcourtViolation on 5/12/2024 in #questions
Assigning slice of a tensor to a variable?
Will do, thanks
7 replies
MModular
Created by Maxim on 1/17/2024 in #questions
how to use the gather function
Both of those links are dead and there is no trace of using the gather function online. 🆘
6 replies