Skip to content

Conversation

@zhiminzhang0830
Copy link
Contributor

@zhiminzhang0830 zhiminzhang0830 commented Aug 15, 2025

PR Category

User Experience

PR Types

New features

Description

add device/dtype/bias paramters for nn.Conv1/2/3D, nn.Embedding
add new api: paddle.nn.Conv1/2/3d

pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Aug 15, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

weight_attr: ParamAttrLike | None = None,
bias_attr: ParamAttrLike | None = None,
data_format: DataLayout3D = "NCDHW",
device: str | PlaceLike | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

这两个位置如果插入到前面去,和torch保持位置一致,不兼容影响大吗

return _C_ops.add(pre_bias, bias)
else:
return pre_bias
with (
Copy link
Contributor

Choose a reason for hiding this comment

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

只改变weight、bias的device,这里中间计算过程的place要改变吗

param = param.to(device)
return param
else:
if in_pir_mode():
Copy link
Contributor

Choose a reason for hiding this comment

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

老静态图可以不管,pir支持device吗

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@4d37570). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #74641   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         3           
  Lines              ?        38           
  Branches           ?         0           
===========================================
  Hits               ?        38           
  Misses             ?         0           
  Partials           ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhiminzhang0830 zhiminzhang0830 changed the title add device/dtype/bias paramters and its unit test for nn.Conv3D [API Compatibility] add device/dtype/bias paramters and its unit test for nn.Conv3D Aug 22, 2025
@zhiminzhang0830 zhiminzhang0830 changed the title [API Compatibility] add device/dtype/bias paramters and its unit test for nn.Conv3D [API Compatibility] add device/dtype/bias paramters and its unit test for nn.Conv1/2/3D/nn.Embedding Aug 25, 2025
embedding_dim,
], "Shape of weight does not match num_embeddings and embedding_dim"
self._weight_attr = ParamAttr(
initializer=paddle.nn.initializer.Assign(value=_weight),
Copy link
Contributor

Choose a reason for hiding this comment

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

这个是不是这样可实现:

_weight.stop_gradient = _freeze
self._weight = _weight

zhwesky2010
zhwesky2010 previously approved these changes Aug 26, 2025
Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 requested a review from SigureMo August 26, 2025 04:17
sparse: bool = False,
_weight: Tensor | None = None,
_freeze: bool = False,
device: str | PlaceLike | None = None,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
device: str | PlaceLike | None = None,
device: PlaceLike | None = None,

PlaceLike 包含 str

Copy link
Member

Choose a reason for hiding this comment

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

下同,其他地方不一一指出

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改,辛苦再review下

weight_attr: ParamAttrLike | None = None,
bias_attr: ParamAttrLike | None = None,
data_format: DataLayoutND = "NCHW",
device: str | PlaceLike | None = None,
Copy link
Member

Choose a reason for hiding this comment

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

这里还没改

SigureMo
SigureMo previously approved these changes Aug 26, 2025
zhwesky2010
zhwesky2010 previously approved these changes Aug 26, 2025
@zhiminzhang0830
Copy link
Contributor Author

/re-run all-failed

@zhiminzhang0830
Copy link
Contributor Author

/re-run all-failed

Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhiminzhang0830
Copy link
Contributor Author

/re-run all-failed

@zhwesky2010 zhwesky2010 merged commit 87f30f6 into PaddlePaddle:develop Aug 27, 2025
91 of 94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants