-- generated by using spec/tuples.yaml

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

module Torch.Internal.Unmanaged.Type.Tuple where


import Foreign.C.String
import Foreign.C.Types
import Foreign
import Torch.Internal.Type
import Torch.Internal.Class

import qualified Language.C.Inline.Cpp as C
import qualified Language.C.Inline.Cpp.Unsafe as C
import qualified Language.C.Inline.Context as C
import qualified Language.C.Types as C
import qualified Data.Map as Map

C.context $ C.cppCtx <> mempty { C.ctxTypesTable = typeTable }

C.include "<ATen/Tensor.h>"
C.include "<tuple>"




-----------------StdTuple '(Tensor,Tensor)---------------------

instance CppTuple2 (Ptr (StdTuple '(Tensor,Tensor))) where
  type A (Ptr (StdTuple '(Tensor,Tensor))) = Ptr Tensor
  type B (Ptr (StdTuple '(Tensor,Tensor))) = Ptr Tensor
  get0 :: Ptr (StdTuple '(Tensor, Tensor))
-> IO (A (Ptr (StdTuple '(Tensor, Tensor))))
get0 Ptr (StdTuple '(Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<0>(*$(std::tuple<at::Tensor,at::Tensor>* v)));}|]
  get1 :: Ptr (StdTuple '(Tensor, Tensor))
-> IO (B (Ptr (StdTuple '(Tensor, Tensor))))
get1 Ptr (StdTuple '(Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<1>(*$(std::tuple<at::Tensor,at::Tensor>* v)));}|]


-----------------StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor)---------------------

instance CppTuple2 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor))) where
  type A (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor))) = Ptr Tensor
  type B (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor))) = Ptr Tensor
  get0 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
-> IO
     (A (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))))
get0 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<0>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>* v)));}|]
  get1 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
-> IO
     (B (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))))
get1 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<1>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>* v)));}|]

instance CppTuple3 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor))) where
  type C (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor))) = Ptr Tensor
  get2 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
-> IO
     (C (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))))
get2 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<2>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>* v)));}|]

instance CppTuple4 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor))) where
  type D (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor))) = Ptr Tensor
  get3 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
-> IO
     (D (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))))
get3 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<3>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>* v)));}|]

instance CppTuple5 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor))) where
  type E (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Tensor))) = Ptr Tensor
  get4 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
-> IO
     (E (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))))
get4 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<4>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>* v)));}|]


-----------------StdTuple '(Tensor,Tensor,Tensor,TensorList)---------------------

instance CppTuple2 (Ptr (StdTuple '(Tensor,Tensor,Tensor,TensorList))) where
  type A (Ptr (StdTuple '(Tensor,Tensor,Tensor,TensorList))) = Ptr Tensor
  type B (Ptr (StdTuple '(Tensor,Tensor,Tensor,TensorList))) = Ptr Tensor
  get0 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
-> IO (A (Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))))
get0 Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<0>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,std::vector<at::Tensor>>* v)));}|]
  get1 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
-> IO (B (Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))))
get1 Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<1>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,std::vector<at::Tensor>>* v)));}|]

instance CppTuple3 (Ptr (StdTuple '(Tensor,Tensor,Tensor,TensorList))) where
  type C (Ptr (StdTuple '(Tensor,Tensor,Tensor,TensorList))) = Ptr Tensor
  get2 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
-> IO (C (Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))))
get2 Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<2>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,std::vector<at::Tensor>>* v)));}|]

instance CppTuple4 (Ptr (StdTuple '(Tensor,Tensor,Tensor,TensorList))) where
  type D (Ptr (StdTuple '(Tensor,Tensor,Tensor,TensorList))) = Ptr TensorList
  get3 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
-> IO (D (Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))))
get3 Ptr (StdTuple '(Tensor, Tensor, Tensor, TensorList))
v = [C.throwBlock| std::vector<at::Tensor>* { return new std::vector<at::Tensor>(std::get<3>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,std::vector<at::Tensor>>* v)));}|]


-----------------StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64)---------------------

instance CppTuple2 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64))) where
  type A (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64))) = Ptr Tensor
  type B (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64))) = Ptr Tensor
  get0 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
-> IO (A (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))))
get0 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<0>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,int64_t>* v)));}|]
  get1 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
-> IO (B (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))))
get1 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<1>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,int64_t>* v)));}|]

instance CppTuple3 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64))) where
  type C (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64))) = Ptr Tensor
  get2 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
-> IO (C (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))))
get2 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<2>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,int64_t>* v)));}|]

instance CppTuple4 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64))) where
  type D (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64))) = Ptr Tensor
  get3 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
-> IO (D (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))))
get3 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<3>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,int64_t>* v)));}|]

instance CppTuple5 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64))) where
  type E (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor,Int64))) = Int64
  get4 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
-> IO (E (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))))
get4 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor, Int64))
v = [C.throwBlock| int64_t { return (std::get<4>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,int64_t>* v)));}|]


-----------------StdTuple '(Tensor,Tensor,Tensor)---------------------

instance CppTuple2 (Ptr (StdTuple '(Tensor,Tensor,Tensor))) where
  type A (Ptr (StdTuple '(Tensor,Tensor,Tensor))) = Ptr Tensor
  type B (Ptr (StdTuple '(Tensor,Tensor,Tensor))) = Ptr Tensor
  get0 :: Ptr (StdTuple '(Tensor, Tensor, Tensor))
-> IO (A (Ptr (StdTuple '(Tensor, Tensor, Tensor))))
get0 Ptr (StdTuple '(Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<0>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor>* v)));}|]
  get1 :: Ptr (StdTuple '(Tensor, Tensor, Tensor))
-> IO (B (Ptr (StdTuple '(Tensor, Tensor, Tensor))))
get1 Ptr (StdTuple '(Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<1>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor>* v)));}|]

instance CppTuple3 (Ptr (StdTuple '(Tensor,Tensor,Tensor))) where
  type C (Ptr (StdTuple '(Tensor,Tensor,Tensor))) = Ptr Tensor
  get2 :: Ptr (StdTuple '(Tensor, Tensor, Tensor))
-> IO (C (Ptr (StdTuple '(Tensor, Tensor, Tensor))))
get2 Ptr (StdTuple '(Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<2>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor>* v)));}|]


-----------------StdTuple '(Tensor,Tensor,Tensor,Tensor)---------------------

instance CppTuple2 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor))) where
  type A (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor))) = Ptr Tensor
  type B (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor))) = Ptr Tensor
  get0 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
-> IO (A (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))))
get0 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<0>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor>* v)));}|]
  get1 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
-> IO (B (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))))
get1 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<1>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor>* v)));}|]

instance CppTuple3 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor))) where
  type C (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor))) = Ptr Tensor
  get2 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
-> IO (C (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))))
get2 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<2>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor>* v)));}|]

instance CppTuple4 (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor))) where
  type D (Ptr (StdTuple '(Tensor,Tensor,Tensor,Tensor))) = Ptr Tensor
  get3 :: Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
-> IO (D (Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))))
get3 Ptr (StdTuple '(Tensor, Tensor, Tensor, Tensor))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<3>(*$(std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor>* v)));}|]


-----------------StdTuple '(Tensor,Tensor,CDouble,Int64)---------------------

instance CppTuple2 (Ptr (StdTuple '(Tensor,Tensor,CDouble,Int64))) where
  type A (Ptr (StdTuple '(Tensor,Tensor,CDouble,Int64))) = Ptr Tensor
  type B (Ptr (StdTuple '(Tensor,Tensor,CDouble,Int64))) = Ptr Tensor
  get0 :: Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
-> IO (A (Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))))
get0 Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<0>(*$(std::tuple<at::Tensor,at::Tensor,double,int64_t>* v)));}|]
  get1 :: Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
-> IO (B (Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))))
get1 Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<1>(*$(std::tuple<at::Tensor,at::Tensor,double,int64_t>* v)));}|]

instance CppTuple3 (Ptr (StdTuple '(Tensor,Tensor,CDouble,Int64))) where
  type C (Ptr (StdTuple '(Tensor,Tensor,CDouble,Int64))) = CDouble
  get2 :: Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
-> IO (C (Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))))
get2 Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
v = [C.throwBlock| double { return (std::get<2>(*$(std::tuple<at::Tensor,at::Tensor,double,int64_t>* v)));}|]

instance CppTuple4 (Ptr (StdTuple '(Tensor,Tensor,CDouble,Int64))) where
  type D (Ptr (StdTuple '(Tensor,Tensor,CDouble,Int64))) = Int64
  get3 :: Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
-> IO (D (Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))))
get3 Ptr (StdTuple '(Tensor, Tensor, CDouble, Int64))
v = [C.throwBlock| int64_t { return (std::get<3>(*$(std::tuple<at::Tensor,at::Tensor,double,int64_t>* v)));}|]


-----------------StdTuple '(CDouble,Int64)---------------------

instance CppTuple2 (Ptr (StdTuple '(CDouble,Int64))) where
  type A (Ptr (StdTuple '(CDouble,Int64))) = CDouble
  type B (Ptr (StdTuple '(CDouble,Int64))) = Int64
  get0 :: Ptr (StdTuple '(CDouble, Int64))
-> IO (A (Ptr (StdTuple '(CDouble, Int64))))
get0 Ptr (StdTuple '(CDouble, Int64))
v = [C.throwBlock| double { return (std::get<0>(*$(std::tuple<double,int64_t>* v)));}|]
  get1 :: Ptr (StdTuple '(CDouble, Int64))
-> IO (B (Ptr (StdTuple '(CDouble, Int64))))
get1 Ptr (StdTuple '(CDouble, Int64))
v = [C.throwBlock| int64_t { return (std::get<1>(*$(std::tuple<double,int64_t>* v)));}|]


-----------------StdTuple '(CDouble,CDouble)---------------------

instance CppTuple2 (Ptr (StdTuple '(CDouble,CDouble))) where
  type A (Ptr (StdTuple '(CDouble,CDouble))) = CDouble
  type B (Ptr (StdTuple '(CDouble,CDouble))) = CDouble
  get0 :: Ptr (StdTuple '(CDouble, CDouble))
-> IO (A (Ptr (StdTuple '(CDouble, CDouble))))
get0 Ptr (StdTuple '(CDouble, CDouble))
v = [C.throwBlock| double { return (std::get<0>(*$(std::tuple<double,double>* v)));}|]
  get1 :: Ptr (StdTuple '(CDouble, CDouble))
-> IO (B (Ptr (StdTuple '(CDouble, CDouble))))
get1 Ptr (StdTuple '(CDouble, CDouble))
v = [C.throwBlock| double { return (std::get<1>(*$(std::tuple<double,double>* v)));}|]

-----------------StdTuple '(Tensor,Generator)---------------------

instance CppTuple2 (Ptr (StdTuple '(Tensor,Generator))) where
  type A (Ptr (StdTuple '(Tensor,Generator))) = Ptr Tensor
  type B (Ptr (StdTuple '(Tensor,Generator))) = Ptr Generator
  get0 :: Ptr (StdTuple '(Tensor, Generator))
-> IO (A (Ptr (StdTuple '(Tensor, Generator))))
get0 Ptr (StdTuple '(Tensor, Generator))
v = [C.throwBlock| at::Tensor* { return new at::Tensor(std::get<0>(*$(std::tuple<at::Tensor,at::Generator>* v)));}|]
  get1 :: Ptr (StdTuple '(Tensor, Generator))
-> IO (B (Ptr (StdTuple '(Tensor, Generator))))
get1 Ptr (StdTuple '(Tensor, Generator))
v = [C.throwBlock| at::Generator* { return new at::Generator(std::get<1>(*$(std::tuple<at::Tensor,at::Generator>* v)));}|]
  makeTuple2 :: (A (Ptr (StdTuple '(Tensor, Generator))),
 B (Ptr (StdTuple '(Tensor, Generator))))
-> IO (Ptr (StdTuple '(Tensor, Generator)))
makeTuple2 (A (Ptr (StdTuple '(Tensor, Generator)))
a,B (Ptr (StdTuple '(Tensor, Generator)))
b) = [C.throwBlock| std::tuple<at::Tensor,at::Generator>* { return new std::tuple<at::Tensor,at::Generator>(std::make_tuple(*$(at::Tensor* a),*$(at::Generator* b)));}|]