Flux.jl/src/ops.jl

9 lines
333 B
Julia
Raw Normal View History

2017-06-09 21:45:16 +00:00
export reshape, tile, fill, cast
2017-06-09 20:13:25 +00:00
2017-06-09 20:34:07 +00:00
import Base: reshape, fill
2017-06-09 20:13:25 +00:00
reshape(x::AbstractArray, dims::AbstractArray) = reshape(x,tuple(dims...))
2017-06-09 20:20:27 +00:00
tile(x::AbstractArray, mult::AbstractArray) = repeat(x,outer=tuple(mult...))
2017-06-09 20:34:07 +00:00
fill{T}(x::T, dims::AbstractArray) = fill(x,tuple(dims...))
2017-06-09 21:45:16 +00:00
cast{T}(x::AbstractArray, ::Type{T}) = convert(Array{T},x)