Skip to content

Commit

Permalink
fix function-redefined
Browse files Browse the repository at this point in the history
  • Loading branch information
lelelelelez committed Jul 30, 2021
1 parent 44e4d57 commit c3974d9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def test_size_type():
out = interpolate(
x, size={2, 2}, mode='bicubic', align_corners=False)

def test_input_shape():
def test_input_shape_1():
x = fluid.data(name="x", shape=[2, 1, 0, 0], dtype="float32")
out = interpolate(
x, size=[3, 3], mode="bicubic", align_corners=False)
Expand All @@ -539,7 +539,7 @@ def test_input_shape():
self.assertRaises(ValueError, test_size_and_scale)
self.assertRaises(ValueError, test_size_and_scale2)
self.assertRaises(TypeError, test_size_type)
self.assertRaises(ValueError, test_input_shape)
self.assertRaises(ValueError, test_input_shape_1)


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
from paddle.fluid import Program, program_guard


def stable_softmax(x):
shiftx = (x - np.max(x)).clip(-64.)
exps = np.exp(shiftx)
return exps / np.sum(exps)


def log_softmax(x, axis=-1):
softmax_out = np.apply_along_axis(stable_softmax, axis, x)
return np.log(softmax_out)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def net():
self.clean(tmp)


class TestGlooWithCloudRoleMaker(unittest.TestCase):
class TestGlooWithCloudRoleMaker1(unittest.TestCase):
def setUp(self):
os.environ["PADDLE_TRAINERS_NUM"] = "1"
os.environ["PADDLE_PSERVERS_IP_PORT_LIST"] = "127.0.0.1:36001"
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/fluid/tests/unittests/test_linspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ def test_dtype():

self.assertRaises(TypeError, test_dtype)

def test_dtype():
def test_dtype1():
fluid.layers.linspace(0, 10, 1.33, dtype="int32")

self.assertRaises(TypeError, test_dtype)
self.assertRaises(TypeError, test_dtype1)

def test_start_type():
fluid.layers.linspace([0], 10, 1, dtype="float32")
Expand Down

1 comment on commit c3974d9

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on c3974d9 Jul 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍PR: #34517 Commit ID: c3974d9 contains failed CI.

Please sign in to comment.