Skip to content

Commit

Permalink
[CodeStyle][UP031][I001] fix test/* (PaddlePaddle#65594)
Browse files Browse the repository at this point in the history
  • Loading branch information
gouzil authored Jul 1, 2024
1 parent 90b2cc2 commit be4f3ea
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 19 deletions.
6 changes: 2 additions & 4 deletions python/paddle/amp/auto_cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,17 +527,15 @@ def amp_guard(
_current_expected_place().get_device_id()
)
warnings.warn(
'%s does not support float16 amp.'
% core.XPUVersion(xpu_version)
f'{core.XPUVersion(xpu_version)} does not support float16 amp.'
)
enable = False
elif (dtype == 'bfloat16') and not _is_xpu_bfloat16_supported():
xpu_version = core.get_xpu_device_version(
_current_expected_place().get_device_id()
)
warnings.warn(
'%s does not support bfloat16 amp.'
% core.XPUVersion(xpu_version)
f'{core.XPUVersion(xpu_version)} does not support bfloat16 amp.'
)
enable = False
# For custom device:
Expand Down
3 changes: 1 addition & 2 deletions test/cinn/ir/test_llir_schedule_bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
# 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 test.cinn.utils.testing import assert_llir_equal

from paddle.cinn import ir, to_cinn_llir
from paddle.cinn.runtime.data_array import DataArray
from paddle.cinn.schedule import IRSchedule as sch
from test.cinn.utils.testing import assert_llir_equal


def test_bind_reduce():
Expand Down
3 changes: 1 addition & 2 deletions test/cinn/ir/test_llir_schedule_compute_at.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from test.cinn.utils.testing import assert_llir_equal

from paddle.cinn import ir, to_cinn_llir
from paddle.cinn.runtime.data_array import DataArray
from paddle.cinn.schedule import IRSchedule as sch
from test.cinn.utils.testing import assert_llir_equal


def test_compute_at_elementwise():
Expand Down
3 changes: 1 addition & 2 deletions test/cinn/ir/test_llir_schedule_compute_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from test.cinn.utils.testing import assert_llir_equal

from paddle.cinn import common, ir, to_cinn_llir
from paddle.cinn.runtime.data_array import DataArray
from paddle.cinn.schedule import IRSchedule as sch
from test.cinn.utils.testing import assert_llir_equal


def test_compute_inline_elementwise():
Expand Down
3 changes: 1 addition & 2 deletions test/cinn/ir/test_llir_schedule_for_kind.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from test.cinn.utils.testing import assert_llir_equal

from paddle.cinn import ir, to_cinn_llir
from paddle.cinn.runtime.data_array import DataArray
from paddle.cinn.schedule import IRSchedule as sch
from test.cinn.utils.testing import assert_llir_equal


# Current Python DSL cannot express the parallel `for`,
Expand Down
3 changes: 1 addition & 2 deletions test/cinn/ir/test_llir_schedule_fuse_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
# limitations under the License.


from test.cinn.utils.testing import assert_llir_equal

from paddle.cinn import ir, to_cinn_llir
from paddle.cinn.runtime.data_array import DataArray
from paddle.cinn.schedule import IRSchedule as sch
from test.cinn.utils.testing import assert_llir_equal


def test_fuse():
Expand Down
3 changes: 1 addition & 2 deletions test/cinn/ir/test_llir_schedule_reorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from test.cinn.utils.testing import assert_llir_equal

from paddle.cinn import ir, to_cinn_llir
from paddle.cinn.runtime.data_array import DataArray
from paddle.cinn.schedule import IRSchedule as sch
from test.cinn.utils.testing import assert_llir_equal


def test_reorder_elementwise():
Expand Down
3 changes: 1 addition & 2 deletions test/cinn/ir/test_llir_schedule_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from test.cinn.utils.testing import assert_llir_equal

from paddle.cinn import ir, to_cinn_llir
from paddle.cinn.runtime.data_array import DataArray
from paddle.cinn.schedule import IRSchedule as sch
from test.cinn.utils.testing import assert_llir_equal


def test_split_reorder_elementwise():
Expand Down
2 changes: 1 addition & 1 deletion test/dygraph_to_static/test_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def dyfunc_print_with_format(x):
# 4. print Tensor with format 2
def dyfunc_print_with_format2(x):
x_t = paddle.to_tensor(x)
print("PrintTensor: %s" % (x_t))
print("PrintTensor: %s" % x_t) # noqa: UP031


# 5. print Tensor in control flow1
Expand Down

0 comments on commit be4f3ea

Please sign in to comment.