|
| 1 | +# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. |
| 2 | + |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | + |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
1 | 15 | from typing import Tuple |
2 | 16 |
|
3 | 17 | import numpy as np |
@@ -63,42 +77,42 @@ class PhyCRNet(base.Arch): |
63 | 77 |
|
64 | 78 | Args: |
65 | 79 | input_channels (int): The input channels. |
66 | | - hidden_channels (Tuple[int]): The hidden channels. |
67 | | - input_kernel_size (Tuple[int]): The input kernel size. |
68 | | - input_stride (Tuple[int]): The input stride. |
69 | | - input_padding (Tuple[int]): The input padding. |
| 80 | + hidden_channels (Tuple[int, ...]): The hidden channels. |
| 81 | + input_kernel_size (Tuple[int, ...]): The input kernel size(s). |
| 82 | + input_stride (Tuple[int, ...]): The input stride(s). |
| 83 | + input_padding (Tuple[int, ...]): The input padding(s). |
70 | 84 | dt (float): The dt parameter. |
71 | | - num_layers (Tuple[int]): The number of layers. |
| 85 | + num_layers (Tuple[int, ...]): The number of layers. |
72 | 86 | upscale_factor (int): The upscale factor. |
73 | | - step (int, optional): The step. Defaults to 1. |
74 | | - effective_step (Tuple[int], optional): The effective step. Defaults to (1). |
| 87 | + step (int, optional): The step(s). Defaults to 1. |
| 88 | + effective_step (Tuple[int, ...], optional): The effective step. Defaults to (1, ). |
75 | 89 |
|
76 | 90 | Examples: |
77 | 91 | >>> import ppsci |
78 | 92 | >>> model = ppsci.arch.PhyCRNet( |
79 | | - ... input_channels=2, |
80 | | - ... hidden_channels=[8, 32, 128, 128], |
81 | | - ... input_kernel_size=[4, 4, 4, 3], |
82 | | - ... input_stride=[2, 2, 2, 1], |
83 | | - ... input_padding=[1, 1, 1, 1], |
84 | | - ... dt=0.002, |
85 | | - ... num_layers=[3, 1], |
86 | | - ... upscale_factor=8 |
87 | | - ... ) |
| 93 | + ... input_channels=2, |
| 94 | + ... hidden_channels=[8, 32, 128, 128], |
| 95 | + ... input_kernel_size=[4, 4, 4, 3], |
| 96 | + ... input_stride=[2, 2, 2, 1], |
| 97 | + ... input_padding=[1, 1, 1, 1], |
| 98 | + ... dt=0.002, |
| 99 | + ... num_layers=[3, 1], |
| 100 | + ... upscale_factor=8 |
| 101 | + ... ) |
88 | 102 | """ |
89 | 103 |
|
90 | 104 | def __init__( |
91 | 105 | self, |
92 | 106 | input_channels: int, |
93 | | - hidden_channels: Tuple[int], |
94 | | - input_kernel_size: Tuple[int], |
95 | | - input_stride: Tuple[int], |
96 | | - input_padding: Tuple[int], |
| 107 | + hidden_channels: Tuple[int, ...], |
| 108 | + input_kernel_size: Tuple[int, ...], |
| 109 | + input_stride: Tuple[int, ...], |
| 110 | + input_padding: Tuple[int, ...], |
97 | 111 | dt: float, |
98 | | - num_layers: Tuple[int], |
| 112 | + num_layers: Tuple[int, ...], |
99 | 113 | upscale_factor: int, |
100 | 114 | step: int = 1, |
101 | | - effective_step: Tuple[int] = (1), |
| 115 | + effective_step: Tuple[int, ...] = (1,), |
102 | 116 | ): |
103 | 117 | super(PhyCRNet, self).__init__() |
104 | 118 |
|
|
0 commit comments