Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tf.raw_ops.ResourceSparseApplyAdagradV2 crashes whengrad shape does not match indices and variable shape #106494

Open
Assignees
Venkat6871
Labels
@KnightGOKU

Description

@KnightGOKU

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

source

TensorFlow version

tf-2.19

Custom code

Yes

OS platform and distribution

No response

Mobile device

No response

Python version

No response

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

Callingtf.raw_ops.ResourceSparseApplyAdagradV2 with a grad tensor whose shape is incompatible with indices and the underlying resource variable can lead to a crash, instead of raising a clear Python exception.

The bug can be reproduced on tf-2.19. Here is thegist.

Standalone code to reproduce the issue

# BUG: tf.raw_ops.ResourceSparseApplyAdagradV2, grad shape mismatchimport tensorflow as tf# Create resource variablevar = tf.Variable(tf.ones([3, 3], dtype=tf.float32))# Create accumulatorsaccum = tf.Variable(tf.zeros([3, 3], dtype=tf.float32))# Sparse indices and valuesindices = tf.constant([0, 2], dtype=tf.int64)values = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], dtype=tf.float32)# Learning rate and epsilonlr = tf.constant(0.01, dtype=tf.float32)epsilon = tf.constant(1e-8, dtype=tf.float32)# Invoke the operationresult = tf.raw_ops.ResourceSparseApplyAdagradV2(    var=var.handle,    accum=accum.handle,    lr=lr,    epsilon=epsilon,    grad=tf.reshape(values, [-1]),# Mismatched shape, crash# grad=values,  # success    indices=indices,    use_locking=False,    update_slots=True)

Relevant log output

> 2025-12-17 15:21:00.264948: F tensorflow/core/framework/tensor_shape.cc:357] Check failed: d<dims() (1 vs. 1)> [1]    3374216 abort (core dumped)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp