GitXplorerGitXplorer
z

tf-slice-assign

public
19 stars
1 forks
3 issues

Commits

List of commits on branch master.
Verified
8dc5fc111601321c96193aa5d11fbc9ac40e78c6

adds automatic publishing and github CI (#8)

zzaccharieramzi committed 3 years ago
Verified
125f11d0c6cb8524771920f065e74aaf468051b9

Create LICENSE (#7)

zzaccharieramzi committed 5 years ago
Unverified
1ff039ba2c25547dc53f4d550300d185816fa165

updated status about SO question

zzaccharieramzi committed 5 years ago
Unverified
11761c634f98f5f6d38829feb93f4e69716c9e33

added install through pip

zzaccharieramzi committed 5 years ago
Unverified
24b6bc5e077787b3161d457fc02da88c28f70436

corrected shape in updated indices reshape

zzaccharieramzi committed 5 years ago
Unverified
89585ac939fe2aa694d76cecbc16cc7c58aea732

added setup.py

zzaccharieramzi committed 5 years ago

README

The README file for this repository.

tf-slice-assign

GitHub Workflow Build Status

A tool for assignment to a slice in TensorFlow.

In TensorFlow, as opposed to Pytorch, it is currently impossible to assign to the slice of a tensor in a range of different settings. To mitigate this issue, tf-slice-assign introduces a single function that allows to do exactly this using tensor_scatter_nd_update.

Use

from tf_slice_assign import slice_assign

new_tensor = slice_assign(old_tensor, assignment, *slice_args)

You can find a relatively simple example here.

Installation

pip install tf-slice-assign

List of GitHub issues and StackOverflow questions regarding TensorFlow slice assignment

In the following table, I am trying to give the reasons as to why no mitigation for the current problem exists.

Link Status
SO Current answer requires creating a tf.Variable for each slice assignment you make
GH Question is about tf.Variable
SO Answers for tf.Variable or using tensor_scatter_update in a non-adaptable way
GH Suggestion to use tensor_scatter_nd_update
GH An answer suggest creating a mask, but a mask can actually be as difficult to create as the indices for tensor_scatter_nd_update