hasktorch-indef-0.0.1.0: Core Hasktorch abstractions wrapping FFI bindings

Copyright(c) Sam Stites 2017
LicenseBSD3
Maintainersam@stites.io
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Torch.Indef.Dynamic.Tensor.ScatterGather

Description

 
Synopsis

Documentation

_gather Source #

Arguments

:: Dynamic 
-> Dynamic 
-> Word

dimension to operate on

-> IndexDynamic 
-> IO () 

From the Lua docs:

Creates a new Tensor from the original tensor by gathering a number of values from each "row", where the rows are along the dimension dim. The values in a LongTensor, passed as index, specify which values to take from each row. Specifically, the resulting Tensor, which will have the same size as the index tensor, is given by

  -- dim = 1
  result[i][j][k]... = src[index[i][j][k]...][j][k]...

  -- dim = 2
  result[i][j][k]... = src[i][index[i][j][k]...][k]...

  -- etc.

where src is the original Tensor.

The same number of values are selected from each row, and the same value cannot be selected from a row more than once. The values in the index tensor must not be larger than the length of the row, that is they must be between 1 and src:size(dim) inclusive. It can be somewhat confusing to ensure that the index tensor has the correct shape. Viewed pictorially:

_scatter Source #

Arguments

:: Dynamic 
-> Word

dimension to operate on

-> IndexDynamic 
-> Dynamic 
-> IO () 

From the Lua docs:

Writes all values from tensor src or the scalar val into self at the specified indices. The indices are specified with respect to the given dimension, dim, in the manner described in gather. Note that, as for gather, the values of index must be between 1 and self:size(dim) inclusive and all values in a row along the specified dimension must be unique.

_scatterAdd Source #

Arguments

:: Dynamic 
-> Word

dimension to operate on

-> IndexDynamic 
-> Dynamic 
-> IO () 

TODO

_scatterFill Source #

Arguments

:: Dynamic 
-> Word

dimension to operate on

-> IndexDynamic 
-> HsReal 
-> IO () 

TODO