I'm entirely new to Julia (just started earlier today), so forgive me if this is a silly question, but despite loving the language, I'm not finding a lot of great debugging help out there.
Basically I just want to define an alternate constructor for a method that will activate on input of an Array containing any type of Integer (int32, uint8, etc...).
I thought this would be relatively simple and wrote the following:
type MyType
weight_matrices::Array{Array{FloatingPoint}}
MyType(layer_sizes::Array{Integer}) =
new([
rand(layer_sizes[i], layer_sizes[i+1]) for i in [1:length(layer_sizes)-1]
])
end
but when I tried using it:
test = MyType([1,2,1])
I get the error:
ERROR: no method MyType(Array{Int64, 1})
Switching the alternate constructor from Array{Integer}
to Array{Int64}
solves the problem as one would assume, but I don't want to restrict the usage that far.
Any idea on how to do this? Any code review would also be much appreciated. I assume this code isn't very "Julian" (is that a thing?) and would love pointers to make this more usable by others.