Struct WorkerException

Inheritance Relationships

Base Type

  • public exception

Struct Documentation

struct torch::data::WorkerException : public exception

An exception thrown when a DataLoader’s worker thread throws an exception, which is caught.

A WorkerException stores an exception_ptr to the original exception thrown in the worker thread.

Public Functions

WorkerException(std::exception_ptr original)

Constructs a WorkerException from an exception_ptr.

const char * what () const noexceptoverride

Public Members

std::exception_ptr original_exception

The original exception thrown in the worker thread.

std::string message

This exception’s message (not the original exception’s message).


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources