Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
DataLoader.ixx File Reference

Device-agnostic data loader interface using abstract tensor data types. More...

#include <type_traits>
#include <cstddef>
#include <memory>
#include <stdexcept>
#include <cstdint>
#include <string>
#include <sstream>
import Compute.CpuMemoryResource;
import Compute.MemoryResource;
import Compute.DeviceType;
import Dnn.TensorDataTypeTraits;
import Dnn.TensorDataType;
import Dnn.Tensor;

Classes

class  Mila::Data::DataLoader< TInputDataType, TTargetDataType, TMemoryResource >
 Device-agnostic data loader interface using abstract tensor data types. More...

Namespaces

namespace  Mila
 Mila main API namespace.

Typedefs

template<TensorDataType TInputDataType = TensorDataType::FP32, TensorDataType TTargetDataType = TInputDataType>
using Mila::Data::CpuDataLoader = DataLoader<TInputDataType, TTargetDataType, CpuMemoryResource>
 CPU data loader with single precision floating point.

Detailed Description

Device-agnostic data loader interface using abstract tensor data types.

This module provides a sophisticated data loading framework for efficiently feeding heterogeneous data into neural network models during training and evaluation processes. Uses abstract TensorDataType enumeration to enable seamless operation across different compute devices (CPU, CUDA, Metal, Rocm ) without exposing device-specific concrete types to host compilation.

Key architectural features:

  • Abstract data type system prevents device-specific compilation dependencies
  • Support for mixed-precision training with different input/target data types
  • Optimized memory resource selection for efficient host-device data transfers
  • Type-safe batch operations with compile-time validation
  • Extensible design for various data sources and formats

Typedef Documentation

◆ CpuDataLoader

template<TensorDataType TInputDataType = TensorDataType::FP32, TensorDataType TTargetDataType = TInputDataType>
using Mila::Data::CpuDataLoader = DataLoader<TInputDataType, TTargetDataType, CpuMemoryResource>
export

CPU data loader with single precision floating point.

Convenient alias for data loaders using standard CPU memory with FP32 data types for both inputs and targets. Suitable for CPU-only training and development workflows.

Template Parameters
TInputDataTypeInput tensor data type (defaults to FP32)
TTargetDataTypeTarget tensor data type (defaults to input type)