Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tf.strings.substr crashes(aborts)  #46900

@DNXie

Description

@DNXie

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below):2.1.0
  • Python version:3.7.6
  • Bazel version (if compiling from source):N/A
  • GCC/Compiler version (if compiling from source):N/A
  • CUDA/cuDNN version:N/A
  • GPU model and memory:N/A

Describe the current behavior
tf.strings.substr crashes(aborts) when len(pos) > len(input)

Describe the expected behavior
expect an exception message if the input unexpected instead of crash.

Standalone code to reproduce the issue

import tensorflow as tf
tf.strings.substr(input='abc', len=1, pos=[1,-1])
import tensorflow as tf
tf.strings.substr(input='abc', len=1, pos=[1,2])

Output:

2021-02-03 22:46:41.234297: F ./tensorflow/core/framework/tensor.h:806] Check failed: new_num_elements == NumElements() (2 vs. 1)
Aborted (core dumped)

Metadata

Metadata

Assignees

Labels

TF 2.1for tracking issues in 2.1 releaseTF 2.4for issues related to TF 2.4comp:opsOPs related issuesstat:awaiting tensorflowerStatus - Awaiting response from tensorflowertype:bugBug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions