This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
generated from ShigureLab/python-lib-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from paddle.base.libpaddle.pir import ( | ||
Block, | ||
Operation, | ||
OpOperand, | ||
OpResult, | ||
PassManager, | ||
Program, | ||
Type, | ||
Value, | ||
check_unregistered_ops, | ||
fake_op_result, | ||
is_fake_op_result, | ||
register_paddle_dialect, | ||
reset_insertion_point_to_end, | ||
reset_insertion_point_to_start, | ||
set_global_program, | ||
set_insertion_point, | ||
translate_to_new_ir, | ||
translate_to_new_ir_with_param_map, | ||
) | ||
|
||
from . import core | ||
from .math_op_patch import monkey_patch_opresult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
|
||
import numpy as np | ||
|
||
from paddle import Tensor | ||
from paddle._typing import DTypeLike, ShapeLike | ||
from paddle.base.core import VarDesc | ||
from paddle.base.libpaddle import DataType | ||
|
||
from ..base.wrapped_decorator import signature_safe_contextmanager | ||
|
||
vartype_to_datatype: dict[VarDesc.VarType, DataType] | ||
|
||
np_type_to_paddle_type: dict[str, DataType] | ||
|
||
def convert_np_dtype_to_dtype_(np_dtype: str | np.dtype) -> DataType: ... | ||
def default_startup_program(): ... | ||
def default_main_program(): ... | ||
def switch_main_program(program): ... | ||
def switch_startup_program(program): ... | ||
@signature_safe_contextmanager | ||
def program_guard(main_program, startup_program=None): ... | ||
|
||
class ParameterMeta: | ||
shape: ShapeLike | ||
dtype: DTypeLike | ||
|
||
def create_parameter( | ||
dtype: DTypeLike, | ||
shape: ShapeLike, | ||
**kwargs: Any, | ||
): ... | ||
def _convert_into_opresult(tensor: Tensor) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
|
||
def monkey_patch_opresult(): | ||
... |