mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Rewrote the TensorBase::random method to support the generation of random number on gpu.
This commit is contained in:
parent
767424af18
commit
498b7eed25
@ -39,9 +39,14 @@ class TensorBase<Derived, ReadOnlyAccessors>
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseNullaryOp<internal::scalar_random_op<Scalar>, const Derived>
|
||||
EIGEN_STRONG_INLINE const TensorCwiseNullaryOp<internal::UniformRandomGenerator<Scalar>, const Derived>
|
||||
random() const {
|
||||
return TensorCwiseNullaryOp<internal::scalar_random_op<Scalar>, const Derived>(derived());
|
||||
return TensorCwiseNullaryOp<internal::UniformRandomGenerator<Scalar>, const Derived>(derived());
|
||||
}
|
||||
template <typename RandomGenerator> EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseNullaryOp<RandomGenerator, const Derived>
|
||||
random() const {
|
||||
return TensorCwiseNullaryOp<RandomGenerator, const Derived>(derived());
|
||||
}
|
||||
|
||||
// Coefficient-wise unary operators
|
||||
|
Loading…
Reference in New Issue
Block a user