Skip to content

Commit

Permalink
Code reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
henrytwo committed Jul 25, 2022
1 parent 6d21b8d commit bfe533f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ TorchMlirLoweringContext::TorchMlirLoweringContext(
function_(
std::make_shared<torch::jit::GraphFunction>(name, graph_, nullptr)),
mlir_context_(mlirContextCreate()) {
RegisterMlirDialects();

for (auto node : post_order) {
Lower(node);
}

RegisterMlirDialects();
}

void TorchMlirLoweringContext::Lower(const Node* node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class TORCH_API TorchMlirComputation : public torch::lazy::Computation {

const std::string debug_string() const;

const std::string to_string() const;
const std::string to_string() const override;

private:
std::vector<std::string> parameter_names_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ struct ReferenceLazyBackendDeviceType : public BackendDeviceType {
ReferenceLazyBackendDeviceType(int8_t device_type)
: device_type_(static_cast<c10::DeviceType>(device_type)) {}

std::string toString() const override { return c10::DeviceTypeName(device_type_); }
std::string toString() const override {
return c10::DeviceTypeName(device_type_);
}

c10::DeviceType device_type_;
};
Expand Down Expand Up @@ -127,11 +129,11 @@ class ReferenceLazyBackendImpl : public torch::lazy::TorchMlirBackendImpl {
/**
* Device Configuration
* */
std::shared_ptr<torch::lazy::BackendDeviceType> GetDefaultDeviceType() const {
std::shared_ptr<torch::lazy::BackendDeviceType>
GetDefaultDeviceType() const override {
return std::make_shared<BackendDeviceType>(default_device_type_);
}


void SetDefaultDeviceType(int8_t device_type) override {
default_device_type_ = ReferenceLazyBackendDeviceType(device_type);
}
Expand Down

0 comments on commit bfe533f

Please sign in to comment.