Skip to content

Commit d5eb99b

Browse files
dance858claude
andcommitted
Trim shared-subexpression comments in multiply and matmul
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7f91975 commit d5eb99b

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

‎src/atoms/bivariate_full_dom/matmul.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,7 @@ static void eval_wsum_hess_chain_rule(expr *node, const double *w)
461461
BTA_matrices_fill_values(mnode->BJg, f->jacobian, mnode->C);
462462
transpose_matrices_fill_values(mnode->C, mnode->CT);
463463

464-
/* H = C + C^T + H_f + H_g, adding each term right after it is evaluated:
465-
if f and g share a subexpression, evaluating g may overwrite f's
466-
hessian values */
464+
/* H = C + C^T + H_f + H_g, adding each term right after it is evaluated */
467465
sum_n_matrices_fill_zero(node->wsum_hess);
468466
sum_n_matrices_fill_add(mnode->C, 0, node->wsum_hess);
469467
sum_n_matrices_fill_add(mnode->CT, 1, node->wsum_hess);

‎src/atoms/bivariate_full_dom/multiply.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ static void eval_wsum_hess_impl(expr *node, const double *w)
191191

192192
// ---------------------------------------------------------------
193193
// compute H = C + C^T + term2 + term3, adding each term right
194-
// after it is evaluated: if x and y share a subexpression,
195-
// evaluating y may overwrite x's hessian values
194+
// after it is evaluated
196195
// ---------------------------------------------------------------
197196
sum_n_matrices_fill_zero(node->wsum_hess);
198197
sum_n_matrices_fill_add(mul_node->C, 0, node->wsum_hess);

0 commit comments

Comments
 (0)