Simplify removes no-ops from the tape (#1759)

* simplify removes no-ops from the tape

* comment
This commit is contained in:
Awni Hannun
2025-01-09 11:23:19 -08:00
committed by GitHub
parent 1ccaf80575
commit da8c885784
4 changed files with 41 additions and 11 deletions

View File

@@ -39,12 +39,11 @@ std::pair<std::vector<array>, ParentsMap> compile_dfs(
const std::vector<array>& outputs,
const std::vector<array>& original_inputs);
// Simplify the tape. Note, this function modifies in-place both the tape and
// the parents map to remove orphaned arrays
// Simplify the tape.
void compile_simplify(
std::vector<array>& tape,
ParentsMap& parents_map,
const std::vector<array>& outputs,
std::vector<array>& outputs,
int passes);
std::vector<array> compile_replace(