Skip to content

Conversation

@changeyoung98
Copy link
Contributor

@changeyoung98 changeyoung98 commented Aug 15, 2025

PR Category

Execute Infrastructure

PR Types

New features

Description

pcard-67164
Bind frombuffer for safetensors.paddle.load.
This functions loads paddle tensor from bytes or buffer objects.

frombuffer(buffer, dtype, count=-1, offset=0)

Usage:

buffer = self.data.numpy().tobytes()
# default value of count and offset means to load the whole buffer.
tmp = paddle.base.core.frombuffer(buffer, self.data.dtype).reshape(self.shape)

@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.

@changeyoung98 changeyoung98 merged commit 6eeade1 into PaddlePaddle:develop Aug 18, 2025
96 of 99 checks passed
@changeyoung98 changeyoung98 deleted the czy-mem branch August 18, 2025 10:51
Luckycheng222 pushed a commit to Luckycheng222/Paddle that referenced this pull request Aug 25, 2025
* add frombuffer

* fix

* add default value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants