Closed ordabayevy closed 3 years ago
I want to change reshaping in the tutorial to use Variable instead of Tensor. (Using Tensor feels more like indexing rather than reshaping.)
Variable
Tensor
Use
layer = Variable("layer", Bint[9]) A_layer = A(height=layer // Number(3, 4), width=layer % Number(3, 4))
instead of
layer = Tensor(tensor([0, 1, 2, 3, 4, 5, 6, 7, 8]), dtype=9)["layer"] A(height=layer // Number(3, 4), width=layer % Number(3, 4))
Also add reshaping back layer->(height,width) example:
layer->(height,width)
height = Variable("height", Bint[3]) width = Variable("width", Bint[3]) A_layer(layer=height * Number(3, 4) + width % Number(3, 4))
Thanks @eb8680 !
I want to change reshaping in the tutorial to use
Variable
instead ofTensor
. (UsingTensor
feels more like indexing rather than reshaping.)Use
instead of
Also add reshaping back
layer->(height,width)
example: