/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/runtime
NameSizeModeActions
argument_spec.h168960644editdlrm
autodiff.h39930644editdlrm
calculate_necessary_args.h21000644editdlrm
custom_operator.h10790644editdlrm
exception_message.h6390644editdlrm
graph_executor.h44770644editdlrm
graph_executor_impl.h39020644editdlrm
graph_iterator.h49630644editdlrm
instruction.h38940644editdlrm
interpreter.h50810644editdlrm
jit_exception.h2700644editdlrm
logging.h26180644editdlrm
operator.h90600644editdlrm
operator_options.h1890644editdlrm
print_handler.h3400644editdlrm
profiling_graph_executor_impl.h20360644editdlrm
profiling_record.h89620644editdlrm
register_ops_utils.h437940644editdlrm
script_profile.h25320644editdlrm
slice_indices_adjust.h8210644editdlrm
symbolic_script.h5980644editdlrm
symbolic_shape_registry.h4250644editdlrm
vararg_functions.h10230644editdlrm
variable_tensor_list.h5450644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/runtime/script_profile.h (2532B)
#pragma once #include #include #include #include #include #include #include namespace torch { namespace jit { namespace profiling { struct Datapoint { using Timepoint = std::chrono::time_point; SourceRange sourceRange; Timepoint start; Timepoint end; explicit Datapoint(SourceRange sr) : sourceRange(std::move(sr)), start(std::chrono::steady_clock::now()) {} }; class TORCH_API InstructionSpan { public: explicit InstructionSpan(Node&); ~InstructionSpan(); InstructionSpan(InstructionSpan&&) = delete; InstructionSpan& operator=(InstructionSpan&&) = delete; private: std::unique_ptr datapoint_; }; } // namespace profiling struct TORCH_API InstructionStats : public CustomClassHolder { int64_t count{0}; std::chrono::nanoseconds duration{0}; }; class TORCH_API SourceStats : public CustomClassHolder { public: using LineMap = c10::Dict>; SourceStats(SourceRef source, LineMap lineMap) : source_(std::move(source)), lineMap_(std::move(lineMap)) {} const SourceRef& getSourceRef() const { return source_; } const LineMap& getLineMap() const { return lineMap_; } private: SourceRef source_; LineMap lineMap_; }; /** * ScriptProfile is an underlying C++ implementation for TorchScript profiling. * The profiling section is specified by calling enable() and disable(): * * ... * scriptProfile.enable(); * ... * (scripts) * ... * scriptProfile.disable(); * ... * * To retrieve collected runtime data, users may call dumpStats() and do * arbitrary filtering on the data they want. Note that dumpStats() should * not be called inside a profiling section. * In general, stats are aggregated per source function body, and then by line * number. */ class TORCH_API ScriptProfile : public CustomClassHolder { // Aggregates datapoints by function source id, then by line number. using LineMap = std::map; using SourceMap = std::map>; public: void enable(); void disable(); const SourceMap& dumpStats(); void addDatapoint(std::shared_ptr); ~ScriptProfile() override; private: bool enabled_{false}; std::vector> datapoints_; SourceMap sourceMap_; }; } // namespace jit } // namespace torch