From 1c5f8e3534b4ffc1766b80bf4f073e467890b62d Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Fri, 16 Mar 2018 14:42:08 +0000 Subject: [PATCH] ndims for shapes --- src/jit/shapes.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jit/shapes.jl b/src/jit/shapes.jl index 45998b0a..3985c185 100644 --- a/src/jit/shapes.jl +++ b/src/jit/shapes.jl @@ -12,6 +12,7 @@ Shape{T}(dims::NTuple{N,Integer}) where {T,N} = Shape{T,N}(dims) Base.size(s::Shape) = s.dims Base.size(s::Shape, n) = s.dims[n] +Base.ndims(s::Shape{T,N}) where {T,N} = N Base.length(s::Shape) = prod(s.dims) Base.eltype(s::Shape{T}) where T = T