{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}

module Torch.Internal.Managed.Type.StdOptional where

import Foreign
import Foreign.C.String
import Foreign.C.Types
import Torch.Internal.Cast
import Torch.Internal.Class
import Torch.Internal.Objects
import Torch.Internal.Type
import qualified Torch.Internal.Unmanaged.Type.StdOptional as Unmanaged

stdOptionalTensor_create :: ForeignPtr Tensor -> IO (ForeignPtr (StdOptional Tensor))
stdOptionalTensor_create :: ForeignPtr Tensor -> IO (ForeignPtr (StdOptional Tensor))
stdOptionalTensor_create ForeignPtr Tensor
tensor = (Ptr Tensor -> IO (Ptr (StdOptional Tensor)))
-> ForeignPtr Tensor -> IO (ForeignPtr (StdOptional Tensor))
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
_cast1 Ptr Tensor -> IO (Ptr (StdOptional Tensor))
Unmanaged.stdOptionalTensor_create ForeignPtr Tensor
tensor

stdOptionalTensor_empty :: IO (ForeignPtr (StdOptional Tensor))
stdOptionalTensor_empty :: IO (ForeignPtr (StdOptional Tensor))
stdOptionalTensor_empty = IO (Ptr (StdOptional Tensor))
-> IO (ForeignPtr (StdOptional Tensor))
forall a ca. Castable a ca => IO ca -> IO a
_cast0 IO (Ptr (StdOptional Tensor))
Unmanaged.stdOptionalTensor_empty

stdOptionalTensor_has_value :: ForeignPtr (StdOptional Tensor) -> IO CBool
stdOptionalTensor_has_value :: ForeignPtr (StdOptional Tensor) -> IO CBool
stdOptionalTensor_has_value ForeignPtr (StdOptional Tensor)
optionalTensor = (Ptr (StdOptional Tensor) -> IO CBool)
-> ForeignPtr (StdOptional Tensor) -> IO CBool
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
_cast1 Ptr (StdOptional Tensor) -> IO CBool
Unmanaged.stdOptionalTensor_has_value ForeignPtr (StdOptional Tensor)
optionalTensor

stdOptionalTensor_value :: ForeignPtr (StdOptional Tensor) -> IO (ForeignPtr Tensor)
stdOptionalTensor_value :: ForeignPtr (StdOptional Tensor) -> IO (ForeignPtr Tensor)
stdOptionalTensor_value ForeignPtr (StdOptional Tensor)
optionalTensor = (Ptr (StdOptional Tensor) -> IO (Ptr Tensor))
-> ForeignPtr (StdOptional Tensor) -> IO (ForeignPtr Tensor)
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
_cast1 Ptr (StdOptional Tensor) -> IO (Ptr Tensor)
Unmanaged.stdOptionalTensor_value ForeignPtr (StdOptional Tensor)
optionalTensor