Skip to content

Commit 2760fad

Browse files
committed
fix sparse bug
1 parent 24ae8a9 commit 2760fad

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tensorflow_addons/optimizers/gradient_accumulator.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,13 @@ def _resource_apply_sparse(self, grad: types.TensorLike, var, indices, apply_sta
105105

106106
def _apply():
107107
if "apply_state" in self._optimizer._sparse_apply_args:
108-
train_op = self._optimizer._resource_apply_sparse(
108+
train_op = self._optimizer._resource_apply_dense(
109109
accum_gradient,
110110
var,
111-
indices,
112111
apply_state=apply_state,
113112
)
114113
else:
115-
train_op = self._optimizer._resource_apply_sparse(
116-
accum_gradient, var, indices
117-
)
114+
train_op = self._optimizer._resource_apply_dense(accum_gradient, var)
118115
reset_op = accum_gradient.assign(
119116
tf.zeros_like(accum_gradient),
120117
use_locking=self._use_locking,

0 commit comments

Comments
 (0)