fix missing-prototypes warnings in torch_cpu (Part 4) (#100849)

This PR fixes more missing-prototypes violations in the torch_cpu source following PRs #100053, #100147 and #100245

Pull Request resolved: https://github.com/pytorch/pytorch/pull/100849
Approved by: https://github.com/albanD
This commit is contained in:
cyy
2023-05-18 03:49:40 +00:00
committed by PyTorch MergeBot
parent 900ca4df59
commit c2f28d1c1d
137 changed files with 572 additions and 773 deletions

View File

@ -76,7 +76,7 @@ bool allArgsAreTensors(const Node* node) {
// These are rarely-used ops. Disallowing them typically eliminates
// corner cases in graph optimizations, allowing for more aggressive
// optimizations and better performance.
bool isUnsupportedOp(const Node* node) {
static bool isUnsupportedOp(const Node* node) {
auto kind = node->kind();
if (kind != aten::__is__ && kind != aten::__isnot__) {
return false;
@ -1587,7 +1587,7 @@ float BlockRunner::benchmark_model(
(static_cast<float>(main_runs) * static_cast<float>(args_list.size()));
}
bool display_ivalue(const IValue& iv) {
static bool display_ivalue(const IValue& iv) {
if (iv.isTensor()) {
std::cout << "Tensor " << iv.toTensor().toString() << " {";
const auto dims = iv.toTensor().sizes();
@ -1622,7 +1622,7 @@ bool display_ivalue(const IValue& iv) {
return false;
}
void display_pnode_info(const ProcessedNode& pnode) {
static void display_pnode_info(const ProcessedNode& pnode) {
pnode.node()->print(std::cout, 0, nullptr, false);
const auto num_inputs = static_cast<uint32_t>(pnode.num_inputs());
for (const auto i : c10::irange(num_inputs)) {