pytorch/c10/core/TensorOptions.cpp
Sebastian Messmer 46772dba0c Move TensorOptions, DefaultTensorOptions and OptionsGuard to c10
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/14646

Reviewed By: ezyang

Differential Revision: D13283494

fbshipit-source-id: c62e7f9b02551926bf8f1e3ddf6ede4ec925d28d
2018-12-03 21:53:24 -08:00

23 lines
573 B
C++

#include <c10/core/TensorOptions.h>
#include <c10/Device.h>
#include <c10/core/Layout.h>
#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>
#include <iostream>
namespace c10 {
std::ostream& operator<<(
std::ostream& stream,
const TensorOptions& options) {
return stream << "TensorOptions(dtype=" << options.dtype()
<< ", device=" << options.device()
<< ", layout=" << options.layout()
<< ", requires_grad=" << std::boolalpha
<< options.requires_grad() << ")";
}
} // namespace c10