Skip to content

Fix the docstring in tf.raw_ops.ThreadPoolHandle() and tf.raw_ops.StatsAggregatorHandleV2() #101521

@ILCSFNO

Description

@ILCSFNO

Issue type

Documentation Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

binary

TensorFlow version

tf v2.20.0-rc0-4-g72fbba3d20f 2.20.0

Custom code

Yes

OS platform and distribution

Linux Ubuntu 22.04

Mobile device

Linux Ubuntu 22.04

Python version

3.9

Bazel version

None

GCC/compiler version

None

CUDA/cuDNN version

None

GPU model and memory

None

Current behavior?

Same as #100522, also find the same several problems in tf.raw_ops.ThreadPoolHandle() and tf.raw_ops.StatsAggregatorHandleV2()

Their docstring is shown here:

op {
graph_op_name: "ThreadPoolHandle"

op {
graph_op_name: "StatsAggregatorHandleV2"
visibility: HIDDEN
}

Standalone code to reproduce the issue

import tensorflow as tf

print("--- Test: ThreadPoolHandle ---")
try:
    container = 'custom_container'
    thread_pool_handle = tf.raw_ops.ThreadPoolHandle(num_threads=8, display_name='RandomDataThreadPool-1', max_intra_op_parallelism=4, container=container, shared_name='')
    print(thread_pool_handle)
except Exception as e:
    print(e)

print("--- Test: StatsAggregatorHandleV2 ---")
try:
    container = 'custom_container'
    stats_handle = tf.raw_ops.StatsAggregatorHandleV2(shared_name='aggregator-1', container=container)
    print(stats_handle)
except Exception as e:
    print(e)

Relevant log output

--- Test: ThreadPoolHandle ---
{{function_node __wrapped__ThreadPoolHandle_device_/job:localhost/replica:0/task:0/device:CPU:0}} container contains invalid characters: custom_container [Op:ThreadPoolHandle] name: 
--- Test: StatsAggregatorHandleV2 ---
{{function_node __wrapped__StatsAggregatorHandleV2_device_/job:localhost/replica:0/task:0/device:CPU:0}} container contains invalid characters: custom_container [Op:StatsAggregatorHandleV2] name: 
2025-10-02 23:57:00.640402: W tensorflow/core/framework/op_kernel.cc:1855] OP_REQUIRES failed at threadpool_dataset_op.cc:135 : INVALID_ARGUMENT: container contains invalid characters: custom_container
2025-10-02 23:57:00.640747: W tensorflow/core/framework/op_kernel.cc:1855] OP_REQUIRES failed at resource_op_kernel.h:76 : INVALID_ARGUMENT: container contains invalid characters: custom_container

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions