Skip to content

Commit

Permalink
Merge pull request #76 from facebookresearch/stop_grad
Browse files Browse the repository at this point in the history
Add stop gradient to tangent vector field calcuation
  • Loading branch information
mfschubert authored Jan 11, 2024
2 parents d461c4b + f75a975 commit 8c7491a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "v0.5.2"
current_version = "v0.5.3"
commit = true
commit_args = "--no-verify"
tag = true
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]

name = "fmmax"
version = "v0.5.2"
version = "v0.5.3"
description = "Fourier modal method with Jax"
readme = "README.md"
requires-python = ">=3.7"
Expand Down
2 changes: 1 addition & 1 deletion src/fmmax/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.

__version__ = "v0.5.2"
__version__ = "v0.5.3"

from . import (
basis,
Expand Down
1 change: 1 addition & 0 deletions src/fmmax/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def compute_tangent_field(
Returns:
The normal field, `(tx, ty)`.
"""
arr = jax.lax.stop_gradient(arr)
batch_shape = arr.shape[:-2]
arr = utils.atleast_nd(arr, n=3)
arr = arr.reshape((-1,) + arr.shape[-2:])
Expand Down

0 comments on commit 8c7491a

Please sign in to comment.