Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions deploy/python_infer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from deploy.python_infer.base import Predictor
from deploy.python_infer.pinn_predictor import PINNPredictor

# alias as PINNPredictor can be used in most cases
GeneralPredictor = PINNPredictor

__all__ = [
"Predictor",
"PINNPredictor",
"GeneralPredictor",
]
11 changes: 11 additions & 0 deletions docs/zh/api/depoly/python_infer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Python_infer(Python 推理) 模块

::: deploy.python_infer
handler: python
options:
members:
- Predictor
- GeneralPredictor
- PINNPredictor
show_root_heading: true
heading_level: 3
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ nav:
- NowcastNet: zh/examples/nowcastnet.md
- DGMR: zh/examples/dgmr.md
- API文档:
- " ":
- ppsci:
- ppsci.arch: zh/api/arch.md
- ppsci.autodiff: zh/api/autodiff.md
- ppsci.constraint: zh/api/constraint.md
Expand Down Expand Up @@ -119,6 +119,8 @@ nav:
- ppsci.visualize: zh/api/visualize.md
- ppsci.experimental: zh/api/experimental.md
- ppsci.probability: zh/api/probability.md
- deploy:
- deploy.python_infer: zh/api/depoly/python_infer.md
- 使用指南: zh/user_guide.md
- 开发与复现指南:
- 开发指南: zh/development.md
Expand Down
9 changes: 5 additions & 4 deletions ppsci/arch/cuboid_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,13 +912,14 @@ def get_initial_z(self, final_mem, T_out):
raise NotImplementedError
return initial_z

def forward(self, x, verbose=False):
def forward(self, x: "paddle.Tensor", verbose: bool = False) -> "paddle.Tensor":
"""
Args:
x: Shape (B, T, H, W, C)
verbose: if True, print intermediate shapes
x (paddle.Tensor): Tensor with shape (B, T, H, W, C).
verbose (bool): if True, print intermediate shapes.

Returns:
out: The output Shape (B, T_out, H, W, C_out)
out (paddle.Tensor): The output Shape (B, T_out, H, W, C_out)
"""

x = self.concat_to_tensor(x, self.input_keys)
Expand Down