UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MLLevelSetNeuralInference.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "NNEModelData.h"
5#include "NNERuntimeCPU.h"
6
7class FMLLevelSet;
8
9namespace Chaos
10{
11
12// Class for MLLevelSet Weight Depended Models
14{
15 public:
23 const bool IsValid() const { return ModelInstance.IsValid(); }
24 void RunInference(TArray<float, TAlignedHeapAllocator<64>>& InputData, TArray<float, TAlignedHeapAllocator<64>>& OutputData, uint32 SingleInputSize, uint32 SingleOutputSize, TArray<TArray<float, TAlignedHeapAllocator<64>>>& ModelWeightsIn) const; // Batched Version of the RunMLModel.
25 bool Serialize(FArchive& Ar);
26
27 private:
28 // Different instances of FMLLevelSetNeuralInference can share the same NNEModel (even with deep copy).
29 // Since each model has its own ModelInstance, this would not cause a problem during inference.
31 TSharedPtr<UE::NNE::IModelInstanceCPU> ModelInstance; //can this be TUniquePtr?
32 TArray<TArray<uint32>> ModelWeightsShapes;
33 CHAOS_API FMLLevelSetNeuralInference(TSharedPtr<UE::NNE::IModelCPU> NNEModel); //needed for serialization
34
35 friend FMLLevelSet;
36};
37}
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition MLLevelSetNeuralInference.h:14
void SetModelWeightsShapes(TArray< TArray< uint32 > > &InModelWeightsShapes)
Definition MLLevelSetNeuralInference.h:22
FMLLevelSetNeuralInference()
Definition MLLevelSetNeuralInference.h:16
FMLLevelSetNeuralInference & operator=(const FMLLevelSetNeuralInference &Other)
Definition MLLevelSetNeuralInference.cpp:33
void RunInference(TArray< float, TAlignedHeapAllocator< 64 > > &InputData, TArray< float, TAlignedHeapAllocator< 64 > > &OutputData, uint32 SingleInputSize, uint32 SingleOutputSize, TArray< TArray< float, TAlignedHeapAllocator< 64 > > > &ModelWeightsIn) const
Definition MLLevelSetNeuralInference.cpp:50
const bool IsValid() const
Definition MLLevelSetNeuralInference.h:23
FMLLevelSetNeuralInference * Copy() const
Definition MLLevelSetNeuralInference.cpp:41
Definition MLLevelset.h:38
Definition Archive.h:1208
Definition ContainerAllocationPolicies.h:447
Definition Array.h:670
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition SkeletalMeshComponent.h:307