1 #pragma once 2 3 namespace at::Reduction { 4 5 // NB: Keep this in sync with Reduction class in torch/nn/_reduction.py 6 // These constants control the reduction behavior of loss functions. 7 // Ideally, this would be a scoped enum, but jit doesn't support that 8 enum Reduction { 9 None, // Do not reduce 10 Mean, // (Possibly weighted) mean of losses 11 Sum, // Sum losses 12 END 13 }; 14 } // namespace at::Reduction 15