ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Rand.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "cloudViewer/core/Dtype.h"
14 
15 namespace cloudViewer {
16 namespace benchmarks {
17 
19 core::Tensor Rand(const core::SizeVector& shape,
20  size_t seed,
21  const std::pair<core::Scalar, core::Scalar>& range,
22  core::Dtype dtype,
23  const core::Device& device = core::Device("CPU:0"));
24 
25 } // namespace benchmarks
26 } // namespace cloudViewer
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
Indexer.h
Scalar.h
core::Tensor
cloudViewer::core::Dtype
Definition: Dtype.h:21
Parallel.h
ParallelFor.h
SizeVector.h
cloudViewer::utility::EstimateMaxThreads
int EstimateMaxThreads()
Estimate the maximum number of threads to be used in a parallel region.
Definition: Parallel.cpp:31
Dispatch.h
cloudViewer::core::Device
Definition: Device.h:18
Utils::random
double random(int low, int high)
Definition: utils.cpp:55
DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL
#define DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL(DTYPE,...)
Definition: Dispatch.h:68
cloudViewer::core::TensorIterator::GetPtr
CLOUDVIEWER_HOST_DEVICE void * GetPtr(int64_t workload_idx) const
Definition: Indexer.h:235
cloudViewer::core::TensorIterator
Definition: Indexer.h:222
cloudViewer::core::SizeVector
Definition: SizeVector.h:70
cloudViewer::benchmarks::Rand
core::Tensor Rand(const core::SizeVector &shape, size_t seed, const std::pair< core::Scalar, core::Scalar > &range, core::Dtype dtype, const core::Device &device)
Returns a Tensor with random values within the range range .
Definition: Rand.cpp:23
cloudViewer::core::Tensor::Empty
static Tensor Empty(const SizeVector &shape, Dtype dtype, const Device &device=Device("CPU:0"))
Create a tensor with uninitialized values.
Definition: Tensor.cpp:400
Rand.h
Tensor.h
cloudViewer::core::ParallelFor
void ParallelFor(const Device &device, int64_t n, const func_t &func)
Definition: ParallelFor.h:111
Dtype.h