Files
pytorch/c10/core/TensorOptions.cpp
Sebastian Messmer d408324350 Move files to/from c10/core and c10/util (#15316)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15316

This starts cleaning up the files in c10 according to the module structure we decided on.

Move to c10/util:
- Half.h, Half-inl.h, Half.cpp, bitcasts.h

Move to c10/core:
- Device.h, Device.cpp
- DeviceType.h, DeviceType.cpp

i-am-not-moving-c2-to-c10

Reviewed By: dzhulgakov

Differential Revision: D13498493

fbshipit-source-id: dfcf1c490474a12ab950c72ca686b8ad86428f63
2019-01-10 16:22:22 -08:00

23 lines
578 B
C++

#include <c10/core/TensorOptions.h>
#include <c10/core/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