Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
TensorOps.Random.ixx File Reference

Device-dispatching random initialization for tensors. More...

#include <concepts>
#include <span>
#include <cstdint>
import Compute.ExecutionContext;
import Dnn.TensorOps.Base;
import Dnn.TensorDataTypeTraits;
import Dnn.TensorDataType;
import Compute.DeviceType;
import Dnn.Tensor;

Namespaces

namespace  Mila
 Mila main API namespace.
namespace  Mila::Dnn

Functions

template<TensorDataType TDataType, typename TMemoryResource>
requires isValidTensor<TDataType, TMemoryResource>
void Mila::Dnn::fill_normal (Tensor< TDataType, TMemoryResource > &tensor, float mean, float stddev, IExecutionContext *exec_context=nullptr)
template<TensorDataType TDataType, typename TMemoryResource>
requires isValidTensor<TDataType, TMemoryResource>
void Mila::Dnn::fill_uniform (Tensor< TDataType, TMemoryResource > &tensor, host_value_t< TDataType > min_val, host_value_t< TDataType > max_val, IExecutionContext *exec_context=nullptr)

Detailed Description

Device-dispatching random initialization for tensors.

Provides fill_normal and fill_uniform entry points, forwarding to device-specific implementations (CPU, CUDA). For CUDA, uses cuRAND for efficient device-side fill.