Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeStyle][Typos][U-9] Fix typo (Unsupport) (part4) #71051

Merged
merged 2 commits into from
Feb 11, 2025
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
1 change: 0 additions & 1 deletion _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ vaccum = 'vaccum'

# These words need to be fixed
setted = 'setted'
UNSUPPORT = 'UNSUPPORT'
4 changes: 2 additions & 2 deletions python/paddle/base/dygraph/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def in_sot_simulation_mode() -> bool:
in_declarative_mode = in_to_static_mode


def to_static_unsupport_argument_warning(
def to_static_unsupported_argument_warning(
func_name, input_names, inputs, support_values
):
"""
Expand Down Expand Up @@ -804,7 +804,7 @@ def grad(
# to calculate grads.
from paddle.static import gradients

to_static_unsupport_argument_warning(
to_static_unsupported_argument_warning(
"paddle.grad",
["retain_graph", "create_grad", "only_inputs", "allow_unused"],
[retain_graph, create_graph, only_inputs, allow_unused],
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/tensor/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2740,7 +2740,7 @@ def assign(x: TensorLike, output: paddle.Tensor | None = None) -> paddle.Tensor:
)
):
raise TypeError(
"Unsupport paddle.assign([Variable, Variable...]) with non-scalar variable."
"Unsupported paddle.assign([Variable, Variable...]) with non-scalar variable."
)

def convert_scalar(x):
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/utils/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def _decompress(fname):
elif zipfile.is_zipfile(fname):
uncompressed_path = _uncompress_file_zip(fname)
else:
raise TypeError(f"Unsupport compress file type {fname}")
raise TypeError(f"Unsupported compress file type {fname}")

return uncompressed_path

Expand Down
4 changes: 2 additions & 2 deletions test/cpp/fluid/benchmark/op_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void OpTester::CreateOpDesc() {
case framework::proto::AttrType::LONGS:
default:
PADDLE_THROW(common::errors::Unimplemented(
"Unsupport attr type %d in OpTester.", type));
"Unsupported attr type %d in OpTester.", type));
}
}
}
Expand Down Expand Up @@ -496,7 +496,7 @@ std::string OpTester::DebugString() {
} break;
default:
PADDLE_THROW(common::errors::Unimplemented(
"Unsupport attr type %d in OpTester.", attr_type));
"Unsupported attr type %d in OpTester.", attr_type));
}
ss << GenSpaces(--count) << "}\n";
}
Expand Down
2 changes: 1 addition & 1 deletion test/dygraph_to_static/ifelse_simple_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def dyfunc_ifelse_ret_int4(x):
if pred:
y = x[index] + 1
index = index + 1
return 'unsupport ret'
return 'unsupported ret'
else:
y = x[index] + 2
return y
2 changes: 1 addition & 1 deletion test/dygraph_to_static/test_load_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self):
super().__init__()

def forward(self, x):
# unsupport g as store.
# unsupported g as store.
t = g * 2 + x
t = f.var * t
return t
Expand Down
2 changes: 1 addition & 1 deletion test/ipu/test_cumsum_op_ipu.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def setUp(self):
self.set_feed_attr()
self.set_op_attrs()

# popart unsupport fp16 cumsum
# part unsupported fp16 cumsum
@property
def fp16_enabled(self):
return False
Expand Down
6 changes: 4 additions & 2 deletions test/legacy_test/test_bce_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ def test_BCELoss_weight(self):
def test_BCELoss_error(self):
paddle.disable_static()
self.assertRaises(
ValueError, paddle.nn.loss.BCELoss, reduction="unsupport reduction"
ValueError,
paddle.nn.loss.BCELoss,
reduction="unsupported reduction",
)
input = paddle.to_tensor([[0.1, 0.3]], dtype='float32')
label = paddle.to_tensor([[0.0, 1.0]], dtype='float32')
Expand All @@ -247,7 +249,7 @@ def test_BCELoss_error(self):
paddle.nn.functional.binary_cross_entropy,
input=input,
label=label,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
paddle.enable_static()

Expand Down
4 changes: 2 additions & 2 deletions test/legacy_test/test_bce_with_logits_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def test_BCEWithLogitsLoss_error(self):
self.assertRaises(
ValueError,
paddle.nn.BCEWithLogitsLoss,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
logit = paddle.to_tensor([[0.1, 0.3]], dtype='float32')
label = paddle.to_tensor([[0.0, 1.0]], dtype='float32')
Expand All @@ -334,7 +334,7 @@ def test_BCEWithLogitsLoss_error(self):
paddle.nn.functional.binary_cross_entropy_with_logits,
logit=logit,
label=label,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
paddle.enable_static()

Expand Down
4 changes: 2 additions & 2 deletions test/legacy_test/test_multi_label_soft_margin_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_MultiLabelSoftMarginLoss_error(self):
self.assertRaises(
ValueError,
paddle.nn.MultiLabelSoftMarginLoss,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
input = paddle.to_tensor([[0.1, 0.3]], dtype='float32')
label = paddle.to_tensor([[0.0, 1.0]], dtype='float32')
Expand All @@ -213,7 +213,7 @@ def test_MultiLabelSoftMarginLoss_error(self):
paddle.nn.functional.multi_label_soft_margin_loss,
input=input,
label=label,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
paddle.enable_static()

Expand Down
4 changes: 2 additions & 2 deletions test/legacy_test/test_multimarginloss.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def test_MultiMarginLoss_error(self):
self.assertRaises(
ValueError,
paddle.nn.MultiMarginLoss,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
input = paddle.to_tensor([[0.1, 0.3]], dtype='float32')
label = paddle.to_tensor([0], dtype='int32')
Expand All @@ -313,7 +313,7 @@ def test_MultiMarginLoss_error(self):
paddle.nn.functional.multi_margin_loss,
input=input,
label=label,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
paddle.enable_static()

Expand Down
4 changes: 3 additions & 1 deletion test/legacy_test/test_norm_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,9 @@ def err_dtype(p, shape_x, xdtype, out=None):
data = paddle.static.data(
name="data_2d", shape=[2, 2], dtype="float64"
)
self.assertRaises(ValueError, paddle.norm, data, p="unsupport norm")
self.assertRaises(
ValueError, paddle.norm, data, p="unsupported norm"
)
self.assertRaises(ValueError, paddle.norm, data, p=[1])
self.assertRaises(ValueError, paddle.norm, data, p=[1], axis=-1)
self.assertRaises(ValueError, paddle.norm, 0, [1, 0], "float64")
Expand Down
2 changes: 1 addition & 1 deletion test/legacy_test/test_poisson_nll_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_dynamic_case(
log_input=log_input,
full=full,
epsilon=epsilon,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
elif type == 'test_err_epsilon':
self.assertRaises(
Expand Down
2 changes: 1 addition & 1 deletion test/legacy_test/test_sigmoid_focal_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def test_SigmoidFocalLoss_error(self):
logit=logit,
label=label,
normalizer=None,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
paddle.enable_static()

Expand Down
4 changes: 2 additions & 2 deletions test/legacy_test/test_soft_margin_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_SoftMarginLoss_error(self):
self.assertRaises(
ValueError,
paddle.nn.loss.SoftMarginLoss,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
input = paddle.to_tensor([[0.1, 0.3]], dtype='float32')
label = paddle.to_tensor([[-1.0, 1.0]], dtype='float32')
Expand All @@ -190,7 +190,7 @@ def test_SoftMarginLoss_error(self):
paddle.nn.functional.soft_margin_loss,
input=input,
label=label,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
paddle.enable_static()

Expand Down
4 changes: 2 additions & 2 deletions test/legacy_test/test_triplet_margin_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_TripletMarginLoss_error(self):
self.assertRaises(
ValueError,
paddle.nn.loss.TripletMarginLoss,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
input = paddle.to_tensor([[0.1, 0.3]], dtype='float32')
positive = paddle.to_tensor([[0.0, 1.0]], dtype='float32')
Expand All @@ -286,7 +286,7 @@ def test_TripletMarginLoss_error(self):
input=input,
positive=positive,
negative=negative,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
paddle.enable_static()

Expand Down
4 changes: 2 additions & 2 deletions test/legacy_test/test_triplet_margin_with_distance_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def test_TripletMarginDistanceLoss_error(self):
self.assertRaises(
ValueError,
paddle.nn.TripletMarginWithDistanceLoss,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
input = paddle.to_tensor([[0.1, 0.3]], dtype='float32')
positive = paddle.to_tensor([[0.0, 1.0]], dtype='float32')
Expand All @@ -288,7 +288,7 @@ def test_TripletMarginDistanceLoss_error(self):
input=input,
positive=positive,
negative=negative,
reduction="unsupport reduction",
reduction="unsupported reduction",
)
paddle.enable_static()

Expand Down
10 changes: 5 additions & 5 deletions test/legacy_test/test_zeropad2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ class TestZeroPad2dAPIError(unittest.TestCase):

def setUp(self):
"""
unsupport dtypes
unsupported dtypes
"""
self.shape = [4, 3, 224, 224]
self.unsupport_dtypes = ['bool', 'int8']
self.unsupported_dtypes = ['bool', 'int8']

def test_unsupport_dtypes(self):
def test_unsupported_dtypes(self):
"""
test unsupport dtypes.
test unsupported dtypes.
"""
for dtype in self.unsupport_dtypes:
for dtype in self.unsupported_dtypes:
pad = 2
x = np.random.randint(-255, 255, size=self.shape)
x_tensor = to_tensor(x).astype(dtype)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def call_locals(x: int, y: paddle.Tensor):
return x + y + len(list(tmp.keys())), list(tmp.keys())


class TestUnsupportFunction(TestCaseBase):
class TestUnsupportedFunction(TestCaseBase):
@strict_mode_guard(False)
def test_locals(self):
x = paddle.to_tensor([2])
Expand Down