module Torch.Internal.Managed.Autograd where

import Foreign.ForeignPtr

import qualified Torch.Internal.Unmanaged.Autograd as Unmanaged
import Torch.Internal.Type
import Torch.Internal.Class
import Torch.Internal.Cast
import Torch.Internal.Objects
import Foreign.C.Types (CBool)


grad :: ForeignPtr Tensor -> ForeignPtr TensorList -> IO (ForeignPtr TensorList)
grad :: ForeignPtr Tensor
-> ForeignPtr TensorList -> IO (ForeignPtr TensorList)
grad = (Ptr Tensor -> Ptr TensorList -> IO (Ptr TensorList))
-> ForeignPtr Tensor
-> ForeignPtr TensorList
-> IO (ForeignPtr TensorList)
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
_cast2 Ptr Tensor -> Ptr TensorList -> IO (Ptr TensorList)
Unmanaged.grad

gradWithOptions :: Bool -> Bool -> Bool -> ForeignPtr Tensor -> ForeignPtr TensorList -> IO (ForeignPtr TensorList)
gradWithOptions :: Bool
-> Bool
-> Bool
-> ForeignPtr Tensor
-> ForeignPtr TensorList
-> IO (ForeignPtr TensorList)
gradWithOptions = (CBool
 -> CBool
 -> CBool
 -> Ptr Tensor
 -> Ptr TensorList
 -> IO (Ptr TensorList))
-> Bool
-> Bool
-> Bool
-> ForeignPtr Tensor
-> ForeignPtr TensorList
-> IO (ForeignPtr TensorList)
forall a ca x1 cx1 x2 cx2 x3 cx3 x4 cx4 y cy.
(Castable a ca, Castable x1 cx1, Castable x2 cx2, Castable x3 cx3,
 Castable x4 cx4, Castable y cy) =>
(ca -> cx1 -> cx2 -> cx3 -> cx4 -> IO cy)
-> a -> x1 -> x2 -> x3 -> x4 -> IO y
_cast5 CBool
-> CBool
-> CBool
-> Ptr Tensor
-> Ptr TensorList
-> IO (Ptr TensorList)
Unmanaged.gradWithOptions

makeIndependent :: ForeignPtr Tensor -> CBool -> IO (ForeignPtr Tensor)
makeIndependent :: ForeignPtr Tensor -> CBool -> IO (ForeignPtr Tensor)
makeIndependent = (Ptr Tensor -> CBool -> IO (Ptr Tensor))
-> ForeignPtr Tensor -> CBool -> IO (ForeignPtr Tensor)
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
_cast2 Ptr Tensor -> CBool -> IO (Ptr Tensor)
Unmanaged.makeIndependent

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