--------------------------------------------------------------------------------
-- <auto-generated>                                                           --
--     This code was generated by a tool.                                     --
--                                                                            --
--     Changes to this file may cause incorrect behavior and will be lost if  --
--     the code is regenerated.                                               --
-- </auto-generated>                                                          --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--                                                                            --
--    Copyright(c) 2018 Alexander Gamper, All Rights Reserved.                --
--                                                                            --
--    Ada-WinRT                                                               --
--                                                                            --
-- This program is free software: you can redistribute it and / or modify     --
-- it under the terms of the GNU Lesser General Public License as published by--
-- the Free Software Foundation, either version 3 of the License, or          --
-- (at your option) any later version.                                        --
--                                                                            --
-- This program is distributed in the hope that it will be useful,            --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of             --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the               --
-- GNU Lesser General Public License for more details.                        --
--                                                                            --
-- You should have received a copy of the GNU Lesser General Public License   --
-- along with this program.If not, see http://www.gnu.org/licenses            --
--                                                                            --
--------------------------------------------------------------------------------
with Windows.Graphics;
with Windows.Graphics.DirectX.Direct3D11;
with Windows.Graphics.Imaging;
with Windows.Media;
with Windows.Storage;
with Windows.Storage.Streams;
with Ada.Unchecked_Conversion;
--------------------------------------------------------------------------------
package body Windows.AI.MachineLearning is

   ------------------------------------------------------------------------
   -- Delegates/Events
   ------------------------------------------------------------------------
   
   function Invoke
   (
      This       : access AsyncOperationCompletedHandler_ILearningModel_Interface
      ; asyncInfo : Windows.AI.MachineLearning.IAsyncOperation_ILearningModel
      ; asyncStatus : Windows.Foundation.AsyncStatus
   )
   return Windows.HRESULT is
      Hr : Windows.HRESULT := S_OK;
   begin
      This.Callback(asyncInfo, asyncStatus);
      return Hr;
   end;
   
   function Invoke
   (
      This       : access AsyncOperationCompletedHandler_ILearningModelEvaluationResult_Interface
      ; asyncInfo : Windows.AI.MachineLearning.IAsyncOperation_ILearningModelEvaluationResult
      ; asyncStatus : Windows.Foundation.AsyncStatus
   )
   return Windows.HRESULT is
      Hr : Windows.HRESULT := S_OK;
   begin
      This.Callback(asyncInfo, asyncStatus);
      return Hr;
   end;
   
   ------------------------------------------------------------------------
   -- Create functions (for activatable classes)
   ------------------------------------------------------------------------
   
   function CreateFromSession
   (
      session : Windows.AI.MachineLearning.ILearningModelSession
   )
   return Windows.AI.MachineLearning.ILearningModelBinding is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModelBinding");
      m_Factory     : Windows.AI.MachineLearning.ILearningModelBindingFactory := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModelBinding := null;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelBindingFactory'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromSession(session, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   (
      deviceKind : Windows.AI.MachineLearning.LearningModelDeviceKind
   )
   return Windows.AI.MachineLearning.ILearningModelDevice is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModelDevice");
      m_Factory     : Windows.AI.MachineLearning.ILearningModelDeviceFactory := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModelDevice := null;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelDeviceFactory'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(deviceKind, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromModel
   (
      model : Windows.AI.MachineLearning.ILearningModel
   )
   return Windows.AI.MachineLearning.ILearningModelSession is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModelSession");
      m_Factory     : Windows.AI.MachineLearning.ILearningModelSessionFactory := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModelSession := null;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelSessionFactory'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromModel(model, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromModelOnDevice
   (
      model : Windows.AI.MachineLearning.ILearningModel
      ; deviceToRunOn : Windows.AI.MachineLearning.ILearningModelDevice
   )
   return Windows.AI.MachineLearning.ILearningModelSession is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModelSession");
      m_Factory     : Windows.AI.MachineLearning.ILearningModelSessionFactory := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModelSession := null;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelSessionFactory'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromModelOnDevice(model, deviceToRunOn, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromModelOnDeviceWithSessionOptions
   (
      model : Windows.AI.MachineLearning.ILearningModel
      ; deviceToRunOn : Windows.AI.MachineLearning.ILearningModelDevice
      ; learningModelSessionOptions : Windows.AI.MachineLearning.ILearningModelSessionOptions
   )
   return Windows.AI.MachineLearning.ILearningModelSession is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModelSession");
      m_Factory     : Windows.AI.MachineLearning.ILearningModelSessionFactory2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModelSession := null;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelSessionFactory2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromModelOnDeviceWithSessionOptions(model, deviceToRunOn, learningModelSessionOptions, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create return Windows.AI.MachineLearning.ILearningModelSessionOptions is
      Hr            : Windows.HResult := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModelSessionOptions");
      Instance      : aliased IInspectable := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased IUnknown := null;
      function Convert is new Ada.Unchecked_Conversion(IUnknown , Windows.AI.MachineLearning.ILearningModelSessionOptions) with inline;
   begin
      Hr := RoActivateInstance(m_hString, Instance'Address);
      if Hr = 0 then
         Hr := Instance.QueryInterface(Windows.AI.MachineLearning.IID_ILearningModelSessionOptions'Access, RetVal'access);
         RefCount := Instance.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return Convert(RetVal);
   end;
   
   ------------------------------------------------------------------------
   -- Override Implementations
   ------------------------------------------------------------------------
   
   ------------------------------------------------------------------------
   -- Static procedures/functions
   ------------------------------------------------------------------------
   
   function CreateFromVideoFrame
   (
      image : Windows.Media.IVideoFrame
   )
   return Windows.AI.MachineLearning.IImageFeatureValue is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.ImageFeatureValue");
      m_Factory     : IImageFeatureValueStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.IImageFeatureValue;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IImageFeatureValueStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromVideoFrame(image, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function LoadFromFilePath
   (
      filePath : Windows.String
   )
   return Windows.AI.MachineLearning.ILearningModel is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModel");
      m_Factory     : ILearningModelStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModel;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.LoadFromFilePath(filePath, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function LoadFromFilePathWithOperatorProvider
   (
      filePath : Windows.String
      ; operatorProvider : Windows.AI.MachineLearning.ILearningModelOperatorProvider
   )
   return Windows.AI.MachineLearning.ILearningModel is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModel");
      m_Factory     : ILearningModelStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModel;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.LoadFromFilePathWithOperatorProvider(filePath, operatorProvider, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function LoadFromStorageFileAsync
   (
      modelFile : Windows.Storage.IStorageFile
   )
   return Windows.AI.MachineLearning.IAsyncOperation_ILearningModel is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModel");
      m_Factory     : ILearningModelStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.IAsyncOperation_ILearningModel;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.LoadFromStorageFileAsync(modelFile, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function LoadFromStorageFileWithOperatorProviderAsync
   (
      modelFile : Windows.Storage.IStorageFile
      ; operatorProvider : Windows.AI.MachineLearning.ILearningModelOperatorProvider
   )
   return Windows.AI.MachineLearning.IAsyncOperation_ILearningModel is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModel");
      m_Factory     : ILearningModelStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.IAsyncOperation_ILearningModel;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.LoadFromStorageFileWithOperatorProviderAsync(modelFile, operatorProvider, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function LoadFromStream
   (
      modelStream : Windows.Storage.Streams.IRandomAccessStreamReference
   )
   return Windows.AI.MachineLearning.ILearningModel is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModel");
      m_Factory     : ILearningModelStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModel;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.LoadFromStream(modelStream, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function LoadFromStreamAsync
   (
      modelStream : Windows.Storage.Streams.IRandomAccessStreamReference
   )
   return Windows.AI.MachineLearning.IAsyncOperation_ILearningModel is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModel");
      m_Factory     : ILearningModelStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.IAsyncOperation_ILearningModel;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.LoadFromStreamAsync(modelStream, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function LoadFromStreamWithOperatorProvider
   (
      modelStream : Windows.Storage.Streams.IRandomAccessStreamReference
      ; operatorProvider : Windows.AI.MachineLearning.ILearningModelOperatorProvider
   )
   return Windows.AI.MachineLearning.ILearningModel is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModel");
      m_Factory     : ILearningModelStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModel;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.LoadFromStreamWithOperatorProvider(modelStream, operatorProvider, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function LoadFromStreamWithOperatorProviderAsync
   (
      modelStream : Windows.Storage.Streams.IRandomAccessStreamReference
      ; operatorProvider : Windows.AI.MachineLearning.ILearningModelOperatorProvider
   )
   return Windows.AI.MachineLearning.IAsyncOperation_ILearningModel is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModel");
      m_Factory     : ILearningModelStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.IAsyncOperation_ILearningModel;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.LoadFromStreamWithOperatorProviderAsync(modelStream, operatorProvider, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromDirect3D11Device
   (
      device : Windows.Graphics.DirectX.Direct3D11.IDirect3DDevice
   )
   return Windows.AI.MachineLearning.ILearningModelDevice is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.LearningModelDevice");
      m_Factory     : ILearningModelDeviceStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ILearningModelDevice;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ILearningModelDeviceStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromDirect3D11Device(device, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorBoolean is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorBoolean");
      m_Factory     : ITensorBooleanStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorBoolean;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorBooleanStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorBoolean is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorBoolean");
      m_Factory     : ITensorBooleanStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorBoolean;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorBooleanStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Boolean_Ptr
   )
   return Windows.AI.MachineLearning.ITensorBoolean is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorBoolean");
      m_Factory     : ITensorBooleanStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorBoolean;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorBooleanStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_Boolean
   )
   return Windows.AI.MachineLearning.ITensorBoolean is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorBoolean");
      m_Factory     : ITensorBooleanStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorBoolean;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorBooleanStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorBoolean is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorBoolean");
      m_Factory     : ITensorBooleanStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorBoolean;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorBooleanStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.Boolean_Ptr
   )
   return Windows.AI.MachineLearning.ITensorBoolean is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorBoolean");
      m_Factory     : ITensorBooleanStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorBoolean;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorBooleanStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorDouble is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorDouble");
      m_Factory     : ITensorDoubleStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorDouble;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorDoubleStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorDouble is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorDouble");
      m_Factory     : ITensorDoubleStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorDouble;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorDoubleStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Double_Ptr
   )
   return Windows.AI.MachineLearning.ITensorDouble is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorDouble");
      m_Factory     : ITensorDoubleStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorDouble;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorDoubleStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_Double
   )
   return Windows.AI.MachineLearning.ITensorDouble is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorDouble");
      m_Factory     : ITensorDoubleStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorDouble;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorDoubleStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorDouble is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorDouble");
      m_Factory     : ITensorDoubleStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorDouble;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorDoubleStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.Double_Ptr
   )
   return Windows.AI.MachineLearning.ITensorDouble is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorDouble");
      m_Factory     : ITensorDoubleStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorDouble;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorDoubleStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorFloat is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat");
      m_Factory     : ITensorFloatStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloatStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorFloat is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat");
      m_Factory     : ITensorFloatStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloatStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Single_Ptr
   )
   return Windows.AI.MachineLearning.ITensorFloat is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat");
      m_Factory     : ITensorFloatStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloatStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_Single
   )
   return Windows.AI.MachineLearning.ITensorFloat is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat");
      m_Factory     : ITensorFloatStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloatStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorFloat is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat");
      m_Factory     : ITensorFloatStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloatStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.Single_Ptr
   )
   return Windows.AI.MachineLearning.ITensorFloat is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat");
      m_Factory     : ITensorFloatStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloatStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorFloat16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat16Bit");
      m_Factory     : ITensorFloat16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloat16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorFloat16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat16Bit");
      m_Factory     : ITensorFloat16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloat16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Single_Ptr
   )
   return Windows.AI.MachineLearning.ITensorFloat16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat16Bit");
      m_Factory     : ITensorFloat16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloat16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_Single
   )
   return Windows.AI.MachineLearning.ITensorFloat16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat16Bit");
      m_Factory     : ITensorFloat16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloat16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorFloat16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat16Bit");
      m_Factory     : ITensorFloat16BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloat16BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.Single_Ptr
   )
   return Windows.AI.MachineLearning.ITensorFloat16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorFloat16Bit");
      m_Factory     : ITensorFloat16BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorFloat16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorFloat16BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt16Bit");
      m_Factory     : ITensorInt16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt16Bit");
      m_Factory     : ITensorInt16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Int16_Ptr
   )
   return Windows.AI.MachineLearning.ITensorInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt16Bit");
      m_Factory     : ITensorInt16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_Int16
   )
   return Windows.AI.MachineLearning.ITensorInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt16Bit");
      m_Factory     : ITensorInt16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt16Bit");
      m_Factory     : ITensorInt16BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt16BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.Int16_Ptr
   )
   return Windows.AI.MachineLearning.ITensorInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt16Bit");
      m_Factory     : ITensorInt16BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt16BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt32Bit");
      m_Factory     : ITensorInt32BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt32BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt32Bit");
      m_Factory     : ITensorInt32BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt32BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Int32_Ptr
   )
   return Windows.AI.MachineLearning.ITensorInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt32Bit");
      m_Factory     : ITensorInt32BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt32BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_Int32
   )
   return Windows.AI.MachineLearning.ITensorInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt32Bit");
      m_Factory     : ITensorInt32BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt32BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt32Bit");
      m_Factory     : ITensorInt32BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt32BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.Int32_Ptr
   )
   return Windows.AI.MachineLearning.ITensorInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt32Bit");
      m_Factory     : ITensorInt32BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt32BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt64Bit");
      m_Factory     : ITensorInt64BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt64BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt64Bit");
      m_Factory     : ITensorInt64BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt64BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Int64_Ptr
   )
   return Windows.AI.MachineLearning.ITensorInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt64Bit");
      m_Factory     : ITensorInt64BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt64BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt64Bit");
      m_Factory     : ITensorInt64BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt64BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt64Bit");
      m_Factory     : ITensorInt64BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt64BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.Int64_Ptr
   )
   return Windows.AI.MachineLearning.ITensorInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt64Bit");
      m_Factory     : ITensorInt64BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt64BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt8Bit");
      m_Factory     : ITensorInt8BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt8BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt8Bit");
      m_Factory     : ITensorInt8BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt8BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.UInt8_Ptr
   )
   return Windows.AI.MachineLearning.ITensorInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt8Bit");
      m_Factory     : ITensorInt8BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt8BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_UInt8
   )
   return Windows.AI.MachineLearning.ITensorInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt8Bit");
      m_Factory     : ITensorInt8BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt8BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt8Bit");
      m_Factory     : ITensorInt8BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt8BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.UInt8_Ptr
   )
   return Windows.AI.MachineLearning.ITensorInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorInt8Bit");
      m_Factory     : ITensorInt8BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorInt8BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorString is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorString");
      m_Factory     : ITensorStringStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorString;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorStringStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorString is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorString");
      m_Factory     : ITensorStringStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorString;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorStringStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.String_Ptr
   )
   return Windows.AI.MachineLearning.ITensorString is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorString");
      m_Factory     : ITensorStringStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorString;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorStringStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_String
   )
   return Windows.AI.MachineLearning.ITensorString is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorString");
      m_Factory     : ITensorStringStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorString;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorStringStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.String_Ptr
   )
   return Windows.AI.MachineLearning.ITensorString is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorString");
      m_Factory     : ITensorStringStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorString;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorStringStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorUInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt16Bit");
      m_Factory     : ITensorUInt16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorUInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt16Bit");
      m_Factory     : ITensorUInt16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.UInt16_Ptr
   )
   return Windows.AI.MachineLearning.ITensorUInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt16Bit");
      m_Factory     : ITensorUInt16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_UInt16
   )
   return Windows.AI.MachineLearning.ITensorUInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt16Bit");
      m_Factory     : ITensorUInt16BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt16BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorUInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt16Bit");
      m_Factory     : ITensorUInt16BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt16BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.UInt16_Ptr
   )
   return Windows.AI.MachineLearning.ITensorUInt16Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt16Bit");
      m_Factory     : ITensorUInt16BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt16Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt16BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorUInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt32Bit");
      m_Factory     : ITensorUInt32BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt32BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorUInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt32Bit");
      m_Factory     : ITensorUInt32BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt32BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.UInt32_Ptr
   )
   return Windows.AI.MachineLearning.ITensorUInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt32Bit");
      m_Factory     : ITensorUInt32BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt32BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_UInt32
   )
   return Windows.AI.MachineLearning.ITensorUInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt32Bit");
      m_Factory     : ITensorUInt32BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt32BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorUInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt32Bit");
      m_Factory     : ITensorUInt32BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt32BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.UInt32_Ptr
   )
   return Windows.AI.MachineLearning.ITensorUInt32Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt32Bit");
      m_Factory     : ITensorUInt32BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt32Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt32BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorUInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt64Bit");
      m_Factory     : ITensorUInt64BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt64BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorUInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt64Bit");
      m_Factory     : ITensorUInt64BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt64BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.UInt64_Ptr
   )
   return Windows.AI.MachineLearning.ITensorUInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt64Bit");
      m_Factory     : ITensorUInt64BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt64BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_UInt64
   )
   return Windows.AI.MachineLearning.ITensorUInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt64Bit");
      m_Factory     : ITensorUInt64BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt64BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorUInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt64Bit");
      m_Factory     : ITensorUInt64BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt64BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.UInt64_Ptr
   )
   return Windows.AI.MachineLearning.ITensorUInt64Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt64Bit");
      m_Factory     : ITensorUInt64BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt64Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt64BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create
   return Windows.AI.MachineLearning.ITensorUInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt8Bit");
      m_Factory     : ITensorUInt8BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt8BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function Create2
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
   )
   return Windows.AI.MachineLearning.ITensorUInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt8Bit");
      m_Factory     : ITensorUInt8BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt8BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.Create2(shape, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromArray
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.UInt8_Ptr
   )
   return Windows.AI.MachineLearning.ITensorUInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt8Bit");
      m_Factory     : ITensorUInt8BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt8BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromIterable
   (
      shape : Windows.Foundation.Collections.IIterable_Int64
      ; data : Windows.Foundation.Collections.IIterable_UInt8
   )
   return Windows.AI.MachineLearning.ITensorUInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt8Bit");
      m_Factory     : ITensorUInt8BitStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt8BitStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromIterable(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromBuffer
   (
      shape : Windows.Int64_Ptr
      ; buffer : Windows.Storage.Streams.IBuffer
   )
   return Windows.AI.MachineLearning.ITensorUInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt8Bit");
      m_Factory     : ITensorUInt8BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt8BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromBuffer(shape, buffer, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function CreateFromShapeArrayAndDataArray
   (
      shape : Windows.Int64_Ptr
      ; data : Windows.UInt8_Ptr
   )
   return Windows.AI.MachineLearning.ITensorUInt8Bit is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.AI.MachineLearning.TensorUInt8Bit");
      m_Factory     : ITensorUInt8BitStatics2 := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.AI.MachineLearning.ITensorUInt8Bit;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITensorUInt8BitStatics2'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.CreateFromShapeArrayAndDataArray(shape, data, RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
end;
