Skip to content

Commit

Permalink
Update doc of reshape
Browse files Browse the repository at this point in the history
  • Loading branch information
tfmlaX committed Dec 17, 2024
1 parent e25e92f commit b387d5a
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/reshape.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
"""
Base.reshape(x::Number, dims...)
Reshape any matrix with dimensions "dims"
Reshape a number `x` into a tensor with `length(dims)` legs that must all be of dimension 1
# Example
```julia-repl
julia> A = rand(2,3,2)
julia> B = reshape(A,4,3)
julia> size(B) == (4,3)
```
"""
function Base.reshape(x::Number, dims...)
prod(dims) == 1 || throw(DimensionMismatch("new dimensions $(dims) must be consistent with array size 1"))
Expand Down

0 comments on commit b387d5a

Please sign in to comment.