Skip to content

Commit

Permalink
Corrected R2::identity_map per garys suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
reverendbedford committed Dec 20, 2024
1 parent fbc1d14 commit fdc99ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/neml2/models/IncrementalRate.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ IncrementalRate<T>::set_value(bool out, bool dout_din, bool d2out_din2)
if (dout_din)
{
if (_dv.is_dependent())
_dv_dt.d(_dv) = Tensor(torch::eye(_dv.base_storage(), _dv.options()) / dt, dt.batch_dim());
_dv_dt.d(_dv) = T::identity_map(_dv.options()) / dt;
if (_t.is_dependent())
_dv_dt.d(_t) = -_dv / dt / dt;
if (_tn.is_dependent())
Expand Down
2 changes: 1 addition & 1 deletion src/neml2/tensors/R2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ R2::R2(const Rot & r)
R4
R2::identity_map(const torch::TensorOptions & options)
{
return SSR4::identity(options);
return torch::eye(9, options).view({3, 3, 3, 3});
}
} // namespace neml2

0 comments on commit fdc99ec

Please sign in to comment.