mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
add float[] str[] constants (#31503)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/31503 Add support for float lists and string lists constants, which enables better constant propagation + constant pooling + freezing. Test Plan: Imported from OSS Differential Revision: D19233558 Pulled By: eellison fbshipit-source-id: 4f7c6d9ddbe7623757a9a20606ce5f394e14e93d
This commit is contained in:
committed by
Facebook Github Bot
parent
6064223808
commit
dd0f2f0c19
@@ -203,6 +203,17 @@ graph(%0 : Tensor,
|
||||
)IR");
|
||||
}
|
||||
|
||||
{
|
||||
checkRoundtrip(
|
||||
R"IR(
|
||||
graph():
|
||||
%0 : float[] = prim::Constant[value=[1., 2., 3.]]()
|
||||
%1 : str[] = prim::Constant[value=["ab", "cd", "ef"]]()
|
||||
%2 : (float[], str[]) = prim::TupleConstruct(%0, %1)
|
||||
return (%2)
|
||||
)IR");
|
||||
}
|
||||
|
||||
{
|
||||
bool error_thrown = false;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user