Skip to content

Commit

Permalink
Fix typo in cross reference
Browse files Browse the repository at this point in the history
  • Loading branch information
BillHuang2001 committed Jan 13, 2025
1 parent 0f0d364 commit 60ab942
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/source/guide/developer/1-modulebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ In the [Quick Start Documentation](#/guide/user/1-start) of the [User Guide](#/g
This process requires four basic class in EvoX:

- [`Algorithm`](#evox.core.components.Algorithm)
- [`Problem`](#evox.core.components.Problems)
- [`Problem`](#evox.core.components.Problem)
- [`Monitor`](evox.core.components.Monitor)
- [`Workflow`](#evox.core.components.Workflow)

Expand Down Expand Up @@ -41,7 +41,7 @@ There are many methods in this class, and some important methods are here:

In EvoX, the [`ModuleBase`](#evox.core.module.ModuleBase) could help to:

- **Contain mutable values**
- **Contain mutable values**

​ This module is an object-oriented one that can contain mutable values.

Expand All @@ -51,7 +51,7 @@ In EvoX, the [`ModuleBase`](#evox.core.module.ModuleBase) could help to:

- **Standardize the initialization**:

​ Basically, predefined submodule(s) which will be ADDED to this module and accessed later in member method(s) should be treated as "non-static members", while any other member(s) should be treated as "static members".
​ Basically, predefined submodule(s) which will be ADDED to this module and accessed later in member method(s) should be treated as "non-static members", while any other member(s) should be treated as "static members".

​ The module initialization for non-static members are recommended to be written in the overwritten method of `setup` (or any other member method) rather than `__init__`.

Expand All @@ -64,7 +64,7 @@ Specifically, there are some rules for using [`ModuleBase`](#evox.core.module.Mo
Static methods to be JIT shall be defined like:

```Python
# one example of the static method defined in a Module
# one example of the static method defined in a Module
@jit
def func(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
return x + y
Expand All @@ -76,9 +76,9 @@ If a method with python dynamic control flows like `if` were to be JIT, a separa
```python
# Set an module inherited from the ModuleBase class
class ExampleModule(ModuleBase):

...

# An example of one method with python dynamic control flows like "if"
# The method using jit(..., trace=False)
@partial(jit, trace=False)
Expand All @@ -87,14 +87,14 @@ class ExampleModule(ModuleBase):
return torch.sin(x)
else:
return torch.tan(x)
# The method to be JIT

# The method to be JIT
@jit
def jit_func(self, p: torch.Tensor) -> torch.Tensor:
return ExampleModule.static_func(p, self.threshold)

...

```

### Supporting for JIT and non-JIT functions
Expand Down

0 comments on commit 60ab942

Please sign in to comment.