@@ -533,15 +533,15 @@ Allocate a storage array appropriate for the computational backend.
533
533
!!! note
534
534
Backend implementations **must** implement `allocate(::NewBackend, T, dims::Tuple)`
535
535
"""
536
- allocate (backend:: Backend , T, dims... ) = allocate (backend, T, dims)
537
- allocate (backend:: Backend , T, dims:: Tuple ) = throw (MethodError (allocate, (backend, T, dims)))
536
+ allocate (backend:: Backend , T:: Type , dims... ) = allocate (backend, T, dims)
537
+ allocate (backend:: Backend , T:: Type , dims:: Tuple ) = throw (MethodError (allocate, (backend, T, dims)))
538
538
539
539
"""
540
540
zeros(::Backend, Type, dims...)::AbstractArray
541
541
542
542
Allocate a storage array appropriate for the computational backend filled with zeros.
543
543
"""
544
- zeros (backend:: Backend , T, dims... ) = zeros (backend, T, dims)
544
+ zeros (backend:: Backend , T:: Type , dims... ) = zeros (backend, T, dims)
545
545
function zeros (backend:: Backend , :: Type{T} , dims:: Tuple ) where {T}
546
546
data = allocate (backend, T, dims... )
547
547
fill! (data, zero (T))
553
553
554
554
Allocate a storage array appropriate for the computational backend filled with ones.
555
555
"""
556
- ones (backend:: Backend , T, dims... ) = ones (backend, T, dims)
556
+ ones (backend:: Backend , T:: Type , dims... ) = ones (backend, T, dims)
557
557
function ones (backend:: Backend , :: Type{T} , dims:: Tuple ) where {T}
558
558
data = allocate (backend, T, dims)
559
559
fill! (data, one (T))
0 commit comments