Skip to main content

A package to perform slice assignment in TensorFlow

Project description

tf-slice-assign

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.

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 No answer for dynamically shaped input
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tf-slice-assign-0.0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

tf_slice_assign-0.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file tf-slice-assign-0.0.1.tar.gz.

File metadata

  • Download URL: tf-slice-assign-0.0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for tf-slice-assign-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bfbe32d7976a84d4be55e8e3312a9f187eb6f67c3ee11d8b2ec90237afc33b99
MD5 82f8b4a3b73b0366872f0001da9bc010
BLAKE2b-256 7cbb7cad30a26a65b740f8da11280eb175625676f1cdba4f1c8b07c8f4eaa3a3

See more details on using hashes here.

File details

Details for the file tf_slice_assign-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: tf_slice_assign-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for tf_slice_assign-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4cbd79920f41e32cd7fde91b16f58ebcdae3e091dae472990aa60e3961285f2
MD5 6f0e2fb5bfec28fcbfccad9868e060f1
BLAKE2b-256 d3f275cc71ad26367bf749241ebbd1aaa19dedbb60cc096a784881b7192d841e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page