{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}

module Torch.Internal.Objects where

import Foreign.C.String
import Foreign.C.Types
import Foreign


import Torch.Internal.Type
import Torch.Internal.Class

foreign import ccall unsafe "hasktorch_finalizer.h &delete_c10dict"
  c_delete_c10dict  :: FunPtr( Ptr (C10Dict '(IValue,IValue)) -> IO () )

foreign import ccall unsafe "hasktorch_finalizer.h delete_c10dict"
  c_delete_c10dict'  :: Ptr (C10Dict '(IValue,IValue)) -> IO ()

instance CppObject (C10Dict '(IValue,IValue)) where
  fromPtr :: Ptr (C10Dict '(IValue, IValue))
-> IO (ForeignPtr (C10Dict '(IValue, IValue)))
fromPtr Ptr (C10Dict '(IValue, IValue))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (C10Dict '(IValue, IValue)) -> IO ())
c_delete_c10dict Ptr (C10Dict '(IValue, IValue))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (C10Dict '(IValue, IValue)) -> IO ()
deletePtr Ptr (C10Dict '(IValue, IValue))
ptr = Ptr (C10Dict '(IValue, IValue)) -> IO ()
c_delete_c10dict' Ptr (C10Dict '(IValue, IValue))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_c10listivalue"
  c_delete_c10listivalue :: FunPtr ( Ptr (C10List IValue) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_c10listivalue"
  c_delete_c10listivalue' ::  Ptr (C10List IValue) -> IO ()

foreign import ccall unsafe "hasktorch_finalizer.h &delete_c10listtensor"
  c_delete_c10listtensor :: FunPtr ( Ptr (C10List Tensor) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_c10listtensor"
  c_delete_c10listtensor' ::  Ptr (C10List Tensor) -> IO ()

foreign import ccall unsafe "hasktorch_finalizer.h &delete_c10listoptionaltensor"
  c_delete_c10listoptionaltensor :: FunPtr ( Ptr (C10List (C10Optional Tensor)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_c10listoptionaltensor"
  c_delete_c10listoptionaltensor' ::  Ptr (C10List (C10Optional Tensor)) -> IO ()

foreign import ccall unsafe "hasktorch_finalizer.h &delete_c10listdouble"
  c_delete_c10listdouble :: FunPtr ( Ptr (C10List CDouble) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_c10listdouble"
  c_delete_c10listdouble' ::  Ptr (C10List CDouble) -> IO ()

foreign import ccall unsafe "hasktorch_finalizer.h &delete_c10listint"
  c_delete_c10listint :: FunPtr ( Ptr (C10List Int64) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_c10listint"
  c_delete_c10listint' ::  Ptr (C10List Int64) -> IO ()

foreign import ccall unsafe "hasktorch_finalizer.h &delete_c10listbool"
  c_delete_c10listbool :: FunPtr ( Ptr (C10List CBool) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_c10listbool"
  c_delete_c10listbool' ::  Ptr (C10List CBool) -> IO ()

instance CppObject (C10List IValue) where
  fromPtr :: Ptr (C10List IValue) -> IO (ForeignPtr (C10List IValue))
fromPtr Ptr (C10List IValue)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (C10List IValue) -> IO ())
c_delete_c10listivalue Ptr (C10List IValue)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (C10List IValue) -> IO ()
deletePtr Ptr (C10List IValue)
ptr = Ptr (C10List IValue) -> IO ()
c_delete_c10listivalue' Ptr (C10List IValue)
ptr
  {-# INLINE deletePtr #-}

instance CppObject (C10List Tensor) where
  fromPtr :: Ptr (C10List Tensor) -> IO (ForeignPtr (C10List Tensor))
fromPtr Ptr (C10List Tensor)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (C10List Tensor) -> IO ())
c_delete_c10listtensor Ptr (C10List Tensor)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (C10List Tensor) -> IO ()
deletePtr Ptr (C10List Tensor)
ptr = Ptr (C10List Tensor) -> IO ()
c_delete_c10listtensor' Ptr (C10List Tensor)
ptr
  {-# INLINE deletePtr #-}

instance CppObject (C10List (C10Optional Tensor)) where
  fromPtr :: Ptr (C10List (C10Optional Tensor))
-> IO (ForeignPtr (C10List (C10Optional Tensor)))
fromPtr Ptr (C10List (C10Optional Tensor))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (C10List (C10Optional Tensor)) -> IO ())
c_delete_c10listoptionaltensor Ptr (C10List (C10Optional Tensor))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (C10List (C10Optional Tensor)) -> IO ()
deletePtr Ptr (C10List (C10Optional Tensor))
ptr = Ptr (C10List (C10Optional Tensor)) -> IO ()
c_delete_c10listoptionaltensor' Ptr (C10List (C10Optional Tensor))
ptr
  {-# INLINE deletePtr #-}

instance CppObject (C10List CDouble) where
  fromPtr :: Ptr (C10List CDouble) -> IO (ForeignPtr (C10List CDouble))
fromPtr Ptr (C10List CDouble)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (C10List CDouble) -> IO ())
c_delete_c10listdouble Ptr (C10List CDouble)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (C10List CDouble) -> IO ()
deletePtr Ptr (C10List CDouble)
ptr = Ptr (C10List CDouble) -> IO ()
c_delete_c10listdouble' Ptr (C10List CDouble)
ptr
  {-# INLINE deletePtr #-}

instance CppObject (C10List Int64) where
  fromPtr :: Ptr (C10List Int64) -> IO (ForeignPtr (C10List Int64))
fromPtr Ptr (C10List Int64)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (C10List Int64) -> IO ())
c_delete_c10listint Ptr (C10List Int64)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (C10List Int64) -> IO ()
deletePtr Ptr (C10List Int64)
ptr = Ptr (C10List Int64) -> IO ()
c_delete_c10listint' Ptr (C10List Int64)
ptr
  {-# INLINE deletePtr #-}

instance CppObject (C10List CBool) where
  fromPtr :: Ptr (C10List CBool) -> IO (ForeignPtr (C10List CBool))
fromPtr Ptr (C10List CBool)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (C10List CBool) -> IO ())
c_delete_c10listbool Ptr (C10List CBool)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (C10List CBool) -> IO ()
deletePtr Ptr (C10List CBool)
ptr = Ptr (C10List CBool) -> IO ()
c_delete_c10listbool' Ptr (C10List CBool)
ptr
  {-# INLINE deletePtr #-}



foreign import ccall unsafe "hasktorch_finalizer.h &delete_c10tuple"
  c_delete_c10tuple :: FunPtr ( Ptr (C10Ptr IVTuple) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_c10tuple"
  c_delete_c10tuple' ::  Ptr (C10Ptr IVTuple) -> IO ()

instance CppObject (C10Ptr IVTuple) where
  fromPtr :: Ptr (C10Ptr IVTuple) -> IO (ForeignPtr (C10Ptr IVTuple))
fromPtr Ptr (C10Ptr IVTuple)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (C10Ptr IVTuple) -> IO ())
c_delete_c10tuple Ptr (C10Ptr IVTuple)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (C10Ptr IVTuple) -> IO ()
deletePtr Ptr (C10Ptr IVTuple)
ptr = Ptr (C10Ptr IVTuple) -> IO ()
c_delete_c10tuple' Ptr (C10Ptr IVTuple)
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_context"
  c_delete_context :: FunPtr ( Ptr Context -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_context"
  c_delete_context' ::  Ptr Context -> IO ()

instance CppObject Context where
  fromPtr :: Ptr Context -> IO (ForeignPtr Context)
fromPtr Ptr Context
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Context -> IO ())
c_delete_context Ptr Context
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Context -> IO ()
deletePtr Ptr Context
ptr = Ptr Context -> IO ()
c_delete_context' Ptr Context
ptr
  {-# INLINE deletePtr #-}


foreign import ccall unsafe "hasktorch_finalizer.h &delete_dimname"
  c_delete_dimname :: FunPtr ( Ptr Dimname -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_dimname"
  c_delete_dimname' ::  Ptr Dimname -> IO ()

instance CppObject Dimname where
  fromPtr :: Ptr Dimname -> IO (ForeignPtr Dimname)
fromPtr Ptr Dimname
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Dimname -> IO ())
c_delete_dimname Ptr Dimname
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Dimname -> IO ()
deletePtr Ptr Dimname
ptr = Ptr Dimname -> IO ()
c_delete_dimname' Ptr Dimname
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_dimnamelist"
  c_delete_dimnamelist :: FunPtr ( Ptr DimnameList -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_dimnamelist"
  c_delete_dimnamelist' ::  Ptr DimnameList -> IO ()

instance CppObject DimnameList where
  fromPtr :: Ptr DimnameList -> IO (ForeignPtr DimnameList)
fromPtr Ptr DimnameList
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr DimnameList -> IO ())
c_delete_dimnamelist Ptr DimnameList
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr DimnameList -> IO ()
deletePtr Ptr DimnameList
ptr = Ptr DimnameList -> IO ()
c_delete_dimnamelist' Ptr DimnameList
ptr
  {-# INLINE deletePtr #-}


foreign import ccall unsafe "hasktorch_finalizer.h &delete_generator"
  c_delete_generator :: FunPtr ( Ptr Generator -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_generator"
  c_delete_generator' ::  Ptr Generator -> IO ()

instance CppObject Generator where
  fromPtr :: Ptr Generator -> IO (ForeignPtr Generator)
fromPtr Ptr Generator
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Generator -> IO ())
c_delete_generator Ptr Generator
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Generator -> IO ()
deletePtr Ptr Generator
ptr = Ptr Generator -> IO ()
c_delete_generator' Ptr Generator
ptr
  {-# INLINE deletePtr #-}


foreign import ccall unsafe "hasktorch_finalizer.h &delete_ivalue"
  c_delete_ivalue :: FunPtr ( Ptr IValue -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_ivalue"
  c_delete_ivalue' ::  Ptr IValue -> IO ()

instance CppObject IValue where
  fromPtr :: Ptr IValue -> IO (ForeignPtr IValue)
fromPtr Ptr IValue
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr IValue -> IO ())
c_delete_ivalue Ptr IValue
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr IValue -> IO ()
deletePtr Ptr IValue
ptr = Ptr IValue -> IO ()
c_delete_ivalue' Ptr IValue
ptr
  {-# INLINE deletePtr #-}


foreign import ccall unsafe "hasktorch_finalizer.h &delete_ivaluelist"
  c_delete_ivaluelist :: FunPtr ( Ptr IValueList -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_ivaluelist"
  c_delete_ivaluelist' ::  Ptr IValueList -> IO ()

instance CppObject IValueList where
  fromPtr :: Ptr IValueList -> IO (ForeignPtr IValueList)
fromPtr Ptr IValueList
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr IValueList -> IO ())
c_delete_ivaluelist Ptr IValueList
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr IValueList -> IO ()
deletePtr Ptr IValueList
ptr = Ptr IValueList -> IO ()
c_delete_ivaluelist' Ptr IValueList
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_intarray"
  c_delete_intarray :: FunPtr ( Ptr IntArray -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_intarray"
  c_delete_intarray' ::  Ptr IntArray -> IO ()

instance CppObject IntArray where
  fromPtr :: Ptr IntArray -> IO (ForeignPtr IntArray)
fromPtr Ptr IntArray
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr IntArray -> IO ())
c_delete_intarray Ptr IntArray
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr IntArray -> IO ()
deletePtr Ptr IntArray
ptr = Ptr IntArray -> IO ()
c_delete_intarray' Ptr IntArray
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_module"
  c_delete_module :: FunPtr ( Ptr Module -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_module"
  c_delete_module' ::  Ptr Module -> IO ()

instance CppObject Module where
  fromPtr :: Ptr Module -> IO (ForeignPtr Module)
fromPtr Ptr Module
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Module -> IO ())
c_delete_module Ptr Module
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Module -> IO ()
deletePtr Ptr Module
ptr = Ptr Module -> IO ()
c_delete_module' Ptr Module
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_jitgraph"
  c_delete_jitgraph :: FunPtr ( Ptr (SharedPtr JitGraph) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_jitgraph"
  c_delete_jitgraph' ::  Ptr (SharedPtr JitGraph) -> IO ()

instance CppObject (SharedPtr JitGraph) where
  fromPtr :: Ptr (SharedPtr JitGraph) -> IO (ForeignPtr (SharedPtr JitGraph))
fromPtr Ptr (SharedPtr JitGraph)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (SharedPtr JitGraph) -> IO ())
c_delete_jitgraph Ptr (SharedPtr JitGraph)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (SharedPtr JitGraph) -> IO ()
deletePtr Ptr (SharedPtr JitGraph)
ptr = Ptr (SharedPtr JitGraph) -> IO ()
c_delete_jitgraph' Ptr (SharedPtr JitGraph)
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_jitnode"
  c_delete_jitnode :: FunPtr ( Ptr JitNode -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_jitnode"
  c_delete_jitnode' ::  Ptr JitNode -> IO ()

instance CppObject JitNode where
  fromPtr :: Ptr JitNode -> IO (ForeignPtr JitNode)
fromPtr Ptr JitNode
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr JitNode -> IO ())
c_delete_jitnode Ptr JitNode
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr JitNode -> IO ()
deletePtr Ptr JitNode
ptr = Ptr JitNode -> IO ()
c_delete_jitnode' Ptr JitNode
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_jitvalue"
  c_delete_jitvalue :: FunPtr ( Ptr JitValue -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_jitvalue"
  c_delete_jitvalue' ::  Ptr JitValue -> IO ()

instance CppObject JitValue where
  fromPtr :: Ptr JitValue -> IO (ForeignPtr JitValue)
fromPtr Ptr JitValue
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr JitValue -> IO ())
c_delete_jitvalue Ptr JitValue
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr JitValue -> IO ()
deletePtr Ptr JitValue
ptr = Ptr JitValue -> IO ()
c_delete_jitvalue' Ptr JitValue
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_scalar"
  c_delete_scalar :: FunPtr ( Ptr Scalar -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_scalar"
  c_delete_scalar' ::  Ptr Scalar -> IO ()

instance CppObject Scalar where
  fromPtr :: Ptr Scalar -> IO (ForeignPtr Scalar)
fromPtr Ptr Scalar
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Scalar -> IO ())
c_delete_scalar Ptr Scalar
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Scalar -> IO ()
deletePtr Ptr Scalar
ptr = Ptr Scalar -> IO ()
c_delete_scalar' Ptr Scalar
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_stdarraybool2"
  c_delete_stdarraybool2 :: FunPtr ( Ptr (StdArray '(CBool,2)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_stdarraybool2"
  c_delete_stdarraybool2' ::  Ptr (StdArray '(CBool,2)) -> IO ()

foreign import ccall unsafe "hasktorch_finalizer.h &delete_stdarraybool3"
  c_delete_stdarraybool3 :: FunPtr ( Ptr (StdArray '(CBool,3)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_stdarraybool3"
  c_delete_stdarraybool3' ::  Ptr (StdArray '(CBool,3)) -> IO ()

foreign import ccall unsafe "hasktorch_finalizer.h &delete_stdarraybool4"
  c_delete_stdarraybool4 :: FunPtr ( Ptr (StdArray '(CBool,4)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_stdarraybool4"
  c_delete_stdarraybool4' ::  Ptr (StdArray '(CBool,4)) -> IO ()

instance CppObject (StdArray '(CBool,2)) where
  fromPtr :: Ptr (StdArray '(CBool, 2))
-> IO (ForeignPtr (StdArray '(CBool, 2)))
fromPtr Ptr (StdArray '(CBool, 2))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdArray '(CBool, 2)) -> IO ())
c_delete_stdarraybool2 Ptr (StdArray '(CBool, 2))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdArray '(CBool, 2)) -> IO ()
deletePtr Ptr (StdArray '(CBool, 2))
ptr = Ptr (StdArray '(CBool, 2)) -> IO ()
c_delete_stdarraybool2' Ptr (StdArray '(CBool, 2))
ptr
  {-# INLINE deletePtr #-}

instance CppObject (StdArray '(CBool,3)) where
  fromPtr :: Ptr (StdArray '(CBool, 3))
-> IO (ForeignPtr (StdArray '(CBool, 3)))
fromPtr Ptr (StdArray '(CBool, 3))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdArray '(CBool, 3)) -> IO ())
c_delete_stdarraybool3 Ptr (StdArray '(CBool, 3))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdArray '(CBool, 3)) -> IO ()
deletePtr Ptr (StdArray '(CBool, 3))
ptr = Ptr (StdArray '(CBool, 3)) -> IO ()
c_delete_stdarraybool3' Ptr (StdArray '(CBool, 3))
ptr
  {-# INLINE deletePtr #-}

instance CppObject (StdArray '(CBool,4)) where
  fromPtr :: Ptr (StdArray '(CBool, 4))
-> IO (ForeignPtr (StdArray '(CBool, 4)))
fromPtr Ptr (StdArray '(CBool, 4))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdArray '(CBool, 4)) -> IO ())
c_delete_stdarraybool4 Ptr (StdArray '(CBool, 4))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdArray '(CBool, 4)) -> IO ()
deletePtr Ptr (StdArray '(CBool, 4))
ptr = Ptr (StdArray '(CBool, 4)) -> IO ()
c_delete_stdarraybool4' Ptr (StdArray '(CBool, 4))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_stdstring"
  c_delete_stdstring :: FunPtr ( Ptr StdString -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_stdstring"
  c_delete_stdstring' ::  Ptr StdString -> IO ()

instance CppObject StdString where
  fromPtr :: Ptr StdString -> IO (ForeignPtr StdString)
fromPtr Ptr StdString
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr StdString -> IO ())
c_delete_stdstring Ptr StdString
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr StdString -> IO ()
deletePtr Ptr StdString
ptr = Ptr StdString -> IO ()
c_delete_stdstring' Ptr StdString
ptr
  {-# INLINE deletePtr #-}



foreign import ccall unsafe "hasktorch_finalizer.h &delete_storage"
  c_delete_storage :: FunPtr ( Ptr Storage -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_storage"
  c_delete_storage' ::  Ptr Storage -> IO ()

instance CppObject Storage where
  fromPtr :: Ptr Storage -> IO (ForeignPtr Storage)
fromPtr Ptr Storage
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Storage -> IO ())
c_delete_storage Ptr Storage
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Storage -> IO ()
deletePtr Ptr Storage
ptr = Ptr Storage -> IO ()
c_delete_storage' Ptr Storage
ptr
  {-# INLINE deletePtr #-}



foreign import ccall unsafe "hasktorch_finalizer.h &delete_symbol"
  c_delete_symbol :: FunPtr ( Ptr Symbol -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_symbol"
  c_delete_symbol' ::  Ptr Symbol -> IO ()

instance CppObject Symbol where
  fromPtr :: Ptr Symbol -> IO (ForeignPtr Symbol)
fromPtr Ptr Symbol
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Symbol -> IO ())
c_delete_symbol Ptr Symbol
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Symbol -> IO ()
deletePtr Ptr Symbol
ptr = Ptr Symbol -> IO ()
c_delete_symbol' Ptr Symbol
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensor"
  c_delete_tensor  :: FunPtr( Ptr Tensor -> IO () )

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensor"
  c_delete_tensor' :: Ptr Tensor -> IO () 

instance CppObject Tensor where
  fromPtr :: Ptr Tensor -> IO (ForeignPtr Tensor)
fromPtr Ptr Tensor
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Tensor -> IO ())
c_delete_tensor Ptr Tensor
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Tensor -> IO ()
deletePtr Ptr Tensor
ptr = Ptr Tensor -> IO ()
c_delete_tensor' Ptr Tensor
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensorindex"
  c_delete_tensorindex :: FunPtr ( Ptr TensorIndex -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensorindex"
  c_delete_tensorindex' ::  Ptr TensorIndex -> IO ()

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensorindexlist"
  c_delete_tensorindexlist :: FunPtr ( Ptr (StdVector TensorIndex) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensorindexlist"
  c_delete_tensorindexlist' ::  Ptr (StdVector TensorIndex) -> IO ()

instance CppObject TensorIndex where
  fromPtr :: Ptr TensorIndex -> IO (ForeignPtr TensorIndex)
fromPtr Ptr TensorIndex
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr TensorIndex -> IO ())
c_delete_tensorindex Ptr TensorIndex
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr TensorIndex -> IO ()
deletePtr Ptr TensorIndex
ptr = Ptr TensorIndex -> IO ()
c_delete_tensorindex' Ptr TensorIndex
ptr
  {-# INLINE deletePtr #-}

instance CppObject (StdVector TensorIndex) where
  fromPtr :: Ptr (StdVector TensorIndex)
-> IO (ForeignPtr (StdVector TensorIndex))
fromPtr Ptr (StdVector TensorIndex)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdVector TensorIndex) -> IO ())
c_delete_tensorindexlist Ptr (StdVector TensorIndex)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdVector TensorIndex) -> IO ()
deletePtr Ptr (StdVector TensorIndex)
ptr = Ptr (StdVector TensorIndex) -> IO ()
c_delete_tensorindexlist' Ptr (StdVector TensorIndex)
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensorlist"
  c_delete_tensorlist :: FunPtr ( Ptr TensorList -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensorlist"
  c_delete_tensorlist' ::  Ptr TensorList -> IO ()

instance CppObject TensorList where
  fromPtr :: Ptr TensorList -> IO (ForeignPtr TensorList)
fromPtr Ptr TensorList
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr TensorList -> IO ())
c_delete_tensorlist Ptr TensorList
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr TensorList -> IO ()
deletePtr Ptr TensorList
ptr = Ptr TensorList -> IO ()
c_delete_tensorlist' Ptr TensorList
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensoroptions"
  c_delete_tensoroptions :: FunPtr ( Ptr TensorOptions -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensoroptions"
  c_delete_tensoroptions' ::  Ptr TensorOptions -> IO ()

instance CppObject TensorOptions where
  fromPtr :: Ptr TensorOptions -> IO (ForeignPtr TensorOptions)
fromPtr Ptr TensorOptions
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr TensorOptions -> IO ())
c_delete_tensoroptions Ptr TensorOptions
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr TensorOptions -> IO ()
deletePtr Ptr TensorOptions
ptr = Ptr TensorOptions -> IO ()
c_delete_tensoroptions' Ptr TensorOptions
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensortensor"
  c_delete_tensortensor :: FunPtr ( Ptr (StdTuple '(Tensor,Tensor)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensortensor"
  c_delete_tensortensor' ::  Ptr (StdTuple '(Tensor,Tensor)) -> IO ()

instance CppObject (StdTuple '(Tensor,Tensor)) where
  fromPtr :: Ptr (StdTuple '(Tensor, Tensor))
-> IO (ForeignPtr (StdTuple '(Tensor, Tensor)))
fromPtr Ptr (StdTuple '(Tensor, Tensor))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdTuple '(Tensor, Tensor)) -> IO ())
c_delete_tensortensor Ptr (StdTuple '(Tensor, Tensor))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(Tensor, Tensor)) -> IO ()
deletePtr Ptr (StdTuple '(Tensor, Tensor))
ptr = Ptr (StdTuple '(Tensor, Tensor)) -> IO ()
c_delete_tensortensor' Ptr (StdTuple '(Tensor, Tensor))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensortensortensortensortensor"
  c_delete_tensortensortensortensortensor :: FunPtr ( Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensortensortensortensortensor"
  c_delete_tensortensortensortensortensor' ::  Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor)) -> IO ()

instance CppObject (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor)) where
  fromPtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
-> IO
     (ForeignPtr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor)))
fromPtr Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr
  (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor)) -> IO ())
c_delete_tensortensortensortensortensor Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor)) -> IO ()
deletePtr Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
ptr = Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor)) -> IO ()
c_delete_tensortensortensortensortensor' Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensortensortensortensorlist"
  c_delete_tensortensortensortensorlist :: FunPtr ( Ptr (StdTuple '(Tensor,Tensor,Tensor,TensorList)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensortensortensortensorlist"
  c_delete_tensortensortensortensorlist' ::  Ptr (StdTuple '(Tensor,Tensor,Tensor,TensorList)) -> IO ()

instance CppObject (StdTuple '(Tensor,Tensor,Tensor,TensorList)) where
  fromPtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
-> IO (ForeignPtr (StdTuple '(Tensor, Tensor, Tensor, TensorList)))
fromPtr Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr
  (Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList)) -> IO ())
c_delete_tensortensortensortensorlist Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList)) -> IO ()
deletePtr Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
ptr = Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList)) -> IO ()
c_delete_tensortensortensortensorlist' Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensortensortensortensorint64"
  c_delete_tensortensortensortensorint64 :: FunPtr ( Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensortensortensortensorint64"
  c_delete_tensortensortensortensorint64' ::  Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64)) -> IO ()

instance CppObject (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64)) where
  fromPtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
-> IO
     (ForeignPtr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64)))
fromPtr Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr
  (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64)) -> IO ())
c_delete_tensortensortensortensorint64 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64)) -> IO ()
deletePtr Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
ptr = Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64)) -> IO ()
c_delete_tensortensortensortensorint64' Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensortensortensor"
  c_delete_tensortensortensor :: FunPtr ( Ptr (StdTuple '(Tensor,Tensor,Tensor)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensortensortensor"
  c_delete_tensortensortensor' ::  Ptr (StdTuple '(Tensor,Tensor,Tensor)) -> IO ()

instance CppObject (StdTuple '(Tensor,Tensor,Tensor)) where
  fromPtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor))
-> IO (ForeignPtr (StdTuple '(Tensor, Tensor, Tensor)))
fromPtr Ptr (StdTuple '(Tensor, Tensor, Tensor))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdTuple '(Tensor, Tensor, Tensor)) -> IO ())
c_delete_tensortensortensor Ptr (StdTuple '(Tensor, Tensor, Tensor))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor)) -> IO ()
deletePtr Ptr (StdTuple '(Tensor, Tensor, Tensor))
ptr = Ptr (StdTuple '(Tensor, Tensor, Tensor)) -> IO ()
c_delete_tensortensortensor' Ptr (StdTuple '(Tensor, Tensor, Tensor))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensortensortensortensor"
  c_delete_tensortensortensortensor :: FunPtr ( Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensortensortensortensor"
  c_delete_tensortensortensortensor' ::  Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor)) -> IO ()

instance CppObject (StdTuple '(Tensor,Tensor,Tensor,Tensor)) where
  fromPtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
-> IO (ForeignPtr (StdTuple '(Tensor, Tensor, Tensor, Tensor)))
fromPtr Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor)) -> IO ())
c_delete_tensortensortensortensor Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor)) -> IO ()
deletePtr Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
ptr = Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor)) -> IO ()
c_delete_tensortensortensortensor' Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_cdoubleint64"
  c_delete_cdoubleint64 :: FunPtr ( Ptr (StdTuple '(CDouble,Int64)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_cdoubleint64"
  c_delete_cdoubleint64' ::  Ptr (StdTuple '(CDouble,Int64)) -> IO ()

instance CppObject (StdTuple '(CDouble,Int64)) where
  fromPtr :: Ptr (StdTuple '(CDouble, Int64))
-> IO (ForeignPtr (StdTuple '(CDouble, Int64)))
fromPtr Ptr (StdTuple '(CDouble, Int64))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdTuple '(CDouble, Int64)) -> IO ())
c_delete_cdoubleint64 Ptr (StdTuple '(CDouble, Int64))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(CDouble, Int64)) -> IO ()
deletePtr Ptr (StdTuple '(CDouble, Int64))
ptr = Ptr (StdTuple '(CDouble, Int64)) -> IO ()
c_delete_cdoubleint64' Ptr (StdTuple '(CDouble, Int64))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_cdoublecdouble"
  c_delete_cdoublecdouble :: FunPtr ( Ptr (StdTuple '(CDouble,CDouble)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_cdoublecdouble"
  c_delete_cdoublecdouble' ::  Ptr (StdTuple '(CDouble,CDouble)) -> IO ()

instance CppObject (StdTuple '(CDouble,CDouble)) where
  fromPtr :: Ptr (StdTuple '(CDouble, CDouble))
-> IO (ForeignPtr (StdTuple '(CDouble, CDouble)))
fromPtr Ptr (StdTuple '(CDouble, CDouble))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdTuple '(CDouble, CDouble)) -> IO ())
c_delete_cdoublecdouble Ptr (StdTuple '(CDouble, CDouble))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(CDouble, CDouble)) -> IO ()
deletePtr Ptr (StdTuple '(CDouble, CDouble))
ptr = Ptr (StdTuple '(CDouble, CDouble)) -> IO ()
c_delete_cdoublecdouble' Ptr (StdTuple '(CDouble, CDouble))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensorgenerator"
  c_delete_tensorgenerator :: FunPtr ( Ptr (StdTuple '(Tensor,Generator)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensorgenerator"
  c_delete_tensorgenerator' ::  Ptr (StdTuple '(Tensor,Generator)) -> IO ()

instance CppObject (StdTuple '(Tensor,Generator)) where
  fromPtr :: Ptr (StdTuple '(Tensor, Generator))
-> IO (ForeignPtr (StdTuple '(Tensor, Generator)))
fromPtr Ptr (StdTuple '(Tensor, Generator))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdTuple '(Tensor, Generator)) -> IO ())
c_delete_tensorgenerator Ptr (StdTuple '(Tensor, Generator))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(Tensor, Generator)) -> IO ()
deletePtr Ptr (StdTuple '(Tensor, Generator))
ptr = Ptr (StdTuple '(Tensor, Generator)) -> IO ()
c_delete_tensorgenerator' Ptr (StdTuple '(Tensor, Generator))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_tensortensorcdoubleint64"
  c_delete_tensortensorcdoubleint64 :: FunPtr ( Ptr (StdTuple '(Tensor,Tensor,CDouble,Int64)) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_tensortensorcdoubleint64"
  c_delete_tensortensorcdoubleint64' ::  Ptr (StdTuple '(Tensor,Tensor,CDouble,Int64)) -> IO ()

instance CppObject (StdTuple '(Tensor,Tensor,CDouble,Int64)) where
  fromPtr :: Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
-> IO (ForeignPtr (StdTuple '(Tensor, Tensor, CDouble, Int64)))
fromPtr Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64)) -> IO ())
c_delete_tensortensorcdoubleint64 Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64)) -> IO ()
deletePtr Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
ptr = Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64)) -> IO ()
c_delete_tensortensorcdoubleint64' Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_optimizer"
  c_delete_optimizer  :: FunPtr( Ptr Optimizer -> IO () )

foreign import ccall unsafe "hasktorch_finalizer.h delete_optimizer"
  c_delete_optimizer' :: Ptr Optimizer -> IO () 

instance CppObject Optimizer where
  fromPtr :: Ptr Optimizer -> IO (ForeignPtr Optimizer)
fromPtr Ptr Optimizer
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Optimizer -> IO ())
c_delete_optimizer Ptr Optimizer
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Optimizer -> IO ()
deletePtr Ptr Optimizer
ptr = Ptr Optimizer -> IO ()
c_delete_optimizer' Ptr Optimizer
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_stdvectordouble"
  c_delete_stdvectordouble :: FunPtr ( Ptr (StdVector CDouble) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_stdvectordouble"
  c_delete_stdvectordouble' ::  Ptr (StdVector CDouble) -> IO ()

instance CppObject (StdVector CDouble) where
  fromPtr :: Ptr (StdVector CDouble) -> IO (ForeignPtr (StdVector CDouble))
fromPtr Ptr (StdVector CDouble)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdVector CDouble) -> IO ())
c_delete_stdvectordouble Ptr (StdVector CDouble)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdVector CDouble) -> IO ()
deletePtr Ptr (StdVector CDouble)
ptr = Ptr (StdVector CDouble) -> IO ()
c_delete_stdvectordouble' Ptr (StdVector CDouble)
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_stdvectorint"
  c_delete_stdvectorint :: FunPtr ( Ptr (StdVector CInt) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_stdvectorint"
  c_delete_stdvectorint' ::  Ptr (StdVector CInt) -> IO ()

instance CppObject (StdVector CInt) where
  fromPtr :: Ptr (StdVector CInt) -> IO (ForeignPtr (StdVector CInt))
fromPtr Ptr (StdVector CInt)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdVector CInt) -> IO ())
c_delete_stdvectorint Ptr (StdVector CInt)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdVector CInt) -> IO ()
deletePtr Ptr (StdVector CInt)
ptr = Ptr (StdVector CInt) -> IO ()
c_delete_stdvectorint' Ptr (StdVector CInt)
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_stdvectorbool"
  c_delete_stdvectorbool :: FunPtr ( Ptr (StdVector CBool) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_stdvectorbool"
  c_delete_stdvectorbool' ::  Ptr (StdVector CBool) -> IO ()

instance CppObject (StdVector CBool) where
  fromPtr :: Ptr (StdVector CBool) -> IO (ForeignPtr (StdVector CBool))
fromPtr Ptr (StdVector CBool)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdVector CBool) -> IO ())
c_delete_stdvectorbool Ptr (StdVector CBool)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdVector CBool) -> IO ()
deletePtr Ptr (StdVector CBool)
ptr = Ptr (StdVector CBool) -> IO ()
c_delete_stdvectorbool' Ptr (StdVector CBool)
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_stream"
  c_delete_stream :: FunPtr ( Ptr Stream -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_stream"
  c_delete_stream' ::  Ptr Stream -> IO ()

instance CppObject Stream where
  fromPtr :: Ptr Stream -> IO (ForeignPtr Stream)
fromPtr Ptr Stream
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr Stream -> IO ())
c_delete_stream Ptr Stream
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr Stream -> IO ()
deletePtr Ptr Stream
ptr = Ptr Stream -> IO ()
c_delete_stream' Ptr Stream
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_arrayrefscalar"
  c_delete_arrayrefscalar :: FunPtr ( Ptr (ArrayRef Scalar) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_arrayrefscalar"
  c_delete_arrayrefscalar' ::  Ptr (ArrayRef Scalar) -> IO ()

instance CppObject (ArrayRef Scalar) where
  fromPtr :: Ptr (ArrayRef Scalar) -> IO (ForeignPtr (ArrayRef Scalar))
fromPtr Ptr (ArrayRef Scalar)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (ArrayRef Scalar) -> IO ())
c_delete_arrayrefscalar Ptr (ArrayRef Scalar)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (ArrayRef Scalar) -> IO ()
deletePtr Ptr (ArrayRef Scalar)
ptr = Ptr (ArrayRef Scalar) -> IO ()
c_delete_arrayrefscalar' Ptr (ArrayRef Scalar)
ptr
  {-# INLINE deletePtr #-}

foreign import ccall unsafe "hasktorch_finalizer.h &delete_vectorscalar"
  c_delete_vectorscalar :: FunPtr ( Ptr (StdVector Scalar) -> IO ())

foreign import ccall unsafe "hasktorch_finalizer.h delete_vectorscalar"
  c_delete_vectorscalar' ::  Ptr (StdVector Scalar) -> IO ()

instance CppObject (StdVector Scalar) where
  fromPtr :: Ptr (StdVector Scalar) -> IO (ForeignPtr (StdVector Scalar))
fromPtr Ptr (StdVector Scalar)
ptr = forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FunPtr (Ptr (StdVector Scalar) -> IO ())
c_delete_vectorscalar Ptr (StdVector Scalar)
ptr
  {-# INLINE fromPtr #-}
  deletePtr :: Ptr (StdVector Scalar) -> IO ()
deletePtr Ptr (StdVector Scalar)
ptr = Ptr (StdVector Scalar) -> IO ()
c_delete_vectorscalar' Ptr (StdVector Scalar)
ptr
  {-# INLINE deletePtr #-}