Files
unity-application/Packages/com.unity.barracuda/Runtime/ONNX/ONNXExtensions.cs
Jelle De Geest c6faf3bf6f Sprint 3
2023-03-26 21:23:17 +00:00

17 lines
360 B
C#

using System;
using System.Linq;
using Onnx;
using UnityEngine;
namespace Unity.Barracuda.ONNX {
static class ONNXExtensions
{
public static int[] AsInts(this TensorShapeProto shape)
{
return shape.Dim.Select(v => v.DimValue < int.MinValue ? int.MinValue : v.DimValue > int.MaxValue ? int.MaxValue : (int)v.DimValue).ToArray();
}
}
}