mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Summary: Add a pass to move all constants to the beginning of the graph, and deduplicate. This extends https://github.com/pytorch/pytorch/pull/10231 to also handle constants introduced in inlining, constant propagation, etc. Pull Request resolved: https://github.com/pytorch/pytorch/pull/12222 Reviewed By: driazati Differential Revision: D10201616 Pulled By: eellison fbshipit-source-id: bc9c5be26868c8b5414257a0d4462de025aeb9bd
16 lines
230 B
C++
16 lines
230 B
C++
#pragma once
|
|
|
|
#include "torch/csrc/jit/ir.h"
|
|
|
|
namespace torch { namespace jit {
|
|
|
|
struct HashNode {
|
|
size_t operator()(const Node* k) const;
|
|
};
|
|
|
|
struct EqualNode {
|
|
bool operator()(const Node* lhs, const Node* rhs) const;
|
|
};
|
|
|
|
}}
|