Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed May 24, 2024
1 parent 8b1f274 commit 32057c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/usage/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ julia> a = Random.rand!(GPUArrays.default_rng(MtlArray), a)
`MPSMatrixRandom` functionality requires Metal.jl > v1.1

!!! warning
`Random.rand!(::MPS.RNG, args...)` andc `Random.randn!(::MPS.RNG, args...)` have a framework limitation that requires the byte offset and byte size of the destination array to be a multiple of 4.
`Random.rand!(::MPS.RNG, args...)` and `Random.randn!(::MPS.RNG, args...)` have a framework limitation that requires the byte offset and byte size of the destination array to be a multiple of 4.
5 changes: 1 addition & 4 deletions lib/mps/matrixrandom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
function MPSMatrixRandomDefaultDistributionDescriptor()
desc = @objc [MPSMatrixRandomDistributionDescriptor defaultDistributionDescriptor]::id{MPSMatrixRandomDistributionDescriptor}
obj = MPSMatrixRandomDistributionDescriptor(desc)
# XXX: who releases this object?
finalizer(release, obj)
return obj
end

Expand All @@ -35,7 +35,6 @@ function MPSMatrixRandomNormalDistributionDescriptor(mean, standardDeviation)
desc = @objc [MPSMatrixRandomDistributionDescriptor normalDistributionDescriptorWithMean:mean::Float32
standardDeviation:standardDeviation::Float32]::id{MPSMatrixRandomDistributionDescriptor}
obj = MPSMatrixRandomDistributionDescriptor(desc)
# XXX: who releases this object?
return obj
end

Expand All @@ -45,15 +44,13 @@ function MPSMatrixRandomNormalDistributionDescriptor(mean, standardDeviation, mi
minimum:minimum::Float32
maximum:maximum::Float32]::id{MPSMatrixRandomDistributionDescriptor}
obj = MPSMatrixRandomDistributionDescriptor(desc)
# XXX: who releases this object?
return obj
end

function MPSMatrixRandomUniformDistributionDescriptor(minimum, maximum)
desc = @objc [MPSMatrixRandomDistributionDescriptor uniformDistributionDescriptorWithMinimum:minimum::Float32
maximum:maximum::Float32]::id{MPSMatrixRandomDistributionDescriptor}
obj = MPSMatrixRandomDistributionDescriptor(desc)
# XXX: who releases this object?
return obj
end

Expand Down

0 comments on commit 32057c1

Please sign in to comment.