xref: /aosp_15_r20/external/pytorch/torch/csrc/jit/passes/utils/optimization_utils.cpp (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #include <torch/csrc/jit/passes/utils/optimization_utils.h>
2 
3 namespace torch {
4 namespace jit {
5 
nonConstantParameters(Node * n)6 bool nonConstantParameters(Node* n) {
7   // Checks if the parameters, not including the
8   // first param are all constants.
9   for (size_t i = 1; i < n->inputs().size(); i++) {
10     if (n->inputs().at(i)->node()->kind() != prim::Constant) {
11       return true;
12     }
13   }
14   return false;
15 }
16 
17 } // namespace jit
18 } // namespace torch
19