hasktorch-0.2.1.2: Haskell bindings to libtorch, supporting both typed and untyped tensors.
Safe HaskellNone
LanguageHaskell2010

Torch.Index

Synopsis

Documentation

slice :: QuasiQuoter Source #

Generate a slice from a python compatible expression. When you take the odd-numbered element of tensor with `tensor[1::2]` in python, you can write `tensor ! [slice|1::2|]` in hasktorch.

lslice :: QuasiQuoter Source #

Generate a lens from a python compatible expression. When you take the odd-numbered elements of tensor with `tensor[1::2]` in python, you can write `tensor ^. [lslice|1::2|]` in hasktorch. When you put 2 in the odd numbered elements of the tensor, you can write `tensor & [lslice|1::2|] ~. 2`.