File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,11 @@ inline std::vector<int> infer_shape_with_minus_one(
9898
9999inline void exec_noop (const NoopNode&, ExecutionState&, StreamOrDevice) {}
100100
101+ inline void
102+ exec_id_copy (const IdCopyNode& n, ExecutionState& st, StreamOrDevice) {
103+ st.set_tensor (n.out , st.const_tensor_ref (n.x ));
104+ }
105+
101106inline void
102107exec_addmm (const AddmmNode& n, ExecutionState& st, StreamOrDevice s) {
103108 const auto & mat1 = st.const_tensor_ref (n.mat1 );
@@ -154,6 +159,9 @@ class Interpreter {
154159 case OpCode::NOOP:
155160 ops::exec_noop (std::get<NoopNode>(instr.node ), st, s);
156161 break ;
162+ case OpCode::ID_COPY:
163+ ops::exec_id_copy (std::get<IdCopyNode>(instr.node ), st, s);
164+ break ;
157165 case OpCode::ADDMM:
158166 ops::exec_addmm (std::get<AddmmNode>(instr.node ), st, s);
159167 break ;
Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ table IntOrVidOrTid {
7272
7373table NoopNode {}
7474
75+ table IdCopyNode {
76+ x : Tid (required );
77+ out : Tid (required );
78+ }
79+
7580table AddmmNode {
7681 mat1 : Tid (required ); // First matrix
7782 mat2 : Tid (required ); // Second matrix
@@ -89,6 +94,7 @@ table AddmmNode {
8994// Reordering or removing members changes numeric type IDs and breaks existing .pte files.
9095union OpNode {
9196 NoopNode ,
97+ IdCopyNode ,
9298 AddmmNode
9399 // BC: Add new op nodes here (append only)
94100}
You can’t perform that action at this time.
0 commit comments