Code/HumanoidRetargeter/Core/Dl/WeightTensor.cs

A small readonly record struct that represents a named float32 tensor within a weights blob. It stores the tensor shape as an int[] in row-major (C) order and the flat float[] data whose length should equal the product of the shape dimensions.

#nullable enable annotations

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace HumanoidRetargeter.Core.Dl;

/// <summary>
/// One named float32 tensor of a <see cref="SameWeights"/> blob.
/// </summary>
/// <param name="Shape">Dimensions (row-major / C order).</param>
/// <param name="Data">Flat float32 data, length = product of <paramref name="Shape"/>.</param>
public readonly record struct WeightTensor(int[] Shape, float[] Data);