@@ -525,15 +525,15 @@ Allocate a storage array appropriate for the computational backend.
525
525
!!! note
526
526
Backend implementations **must** implement `allocate(::NewBackend, T, dims::Tuple)`
527
527
"""
528
- allocate (backend:: Backend , T, dims... ) = allocate (backend, T, dims)
529
- allocate (backend:: Backend , T, dims:: Tuple ) = throw (MethodError (allocate, (backend, T, dims)))
528
+ allocate (backend:: Backend , T:: Type , dims... ) = allocate (backend, T, dims)
529
+ allocate (backend:: Backend , T:: Type , dims:: Tuple ) = throw (MethodError (allocate, (backend, T, dims)))
530
530
531
531
"""
532
532
zeros(::Backend, Type, dims...)::AbstractArray
533
533
534
534
Allocate a storage array appropriate for the computational backend filled with zeros.
535
535
"""
536
- zeros (backend:: Backend , T, dims... ) = zeros (backend, T, dims)
536
+ zeros (backend:: Backend , T:: Type , dims... ) = zeros (backend, T, dims)
537
537
function zeros (backend:: Backend , :: Type{T} , dims:: Tuple ) where {T}
538
538
data = allocate (backend, T, dims... )
539
539
fill! (data, zero (T))
545
545
546
546
Allocate a storage array appropriate for the computational backend filled with ones.
547
547
"""
548
- ones (backend:: Backend , T, dims... ) = ones (backend, T, dims)
548
+ ones (backend:: Backend , T:: Type , dims... ) = ones (backend, T, dims)
549
549
function ones (backend:: Backend , :: Type{T} , dims:: Tuple ) where {T}
550
550
data = allocate (backend, T, dims)
551
551
fill! (data, one (T))
0 commit comments