Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function weight_variable(shape)
- initial = map(Float32, rand(Normal(0,0.001), shape...))
- return Variable(initial)
- end
- logits = zeros(Float32, (10,1,9,4))
- weight = weight_variable([10,36,1])
- weight = reshape(weight, (36,10))
- input = reshape([1 2 3 4 5 6 7 8 9 10], (10,1))
- logits_bis = weight * input
- logits_bis = reshape(logits_bis, (9,4))
- logits = 10×1×9×4 Array{Float32,4}
- logits_bis = <Tensor Reshape_5:1 shape=(9, 4) dtype=Float32>
- logits[1,1,:,:] = 9×4 Array{Float32,2}
- logits[1,1,:,:] = logits_bis
- ERROR: MethodError: Cannot `convert` an object of type TensorFlow.Tensor{Float32} to an object of type Float32
- This may have arisen from a call to the constructor Float32(...),
- since type constructors fall back to convert methods.
Add Comment
Please, Sign In to add comment