Skip to content

Commit

Permalink
refine chore code
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowHCH committed Jul 1, 2024
1 parent a15a76e commit a2419af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 37 deletions.
2 changes: 2 additions & 0 deletions runtime/python/brt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def brt_dtype_to_torch_dtype(dtype: brt.DType):
return torch.float64
if dtype == brt.DType.bool:
return torch.bool
if dtype == brt.DType.int1:
return torch.bool
if dtype == brt.DType.int8:
return torch.int8
if dtype == brt.DType.int16:
Expand Down
4 changes: 2 additions & 2 deletions tests/compatibilty_test/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# ==============================================================================

import brt
from brt.utils import brt_dtype_to_torch_dtype

import torch
import numpy as np
import os
import re

from reporting import TestResult
from utils import (mlir_type_to_torch_dtype)


class BRTBackend:
Expand All @@ -47,7 +47,7 @@ def _generate_torch_outputs(self):
for offset in self.session.get_output_arg_offsets():
outputs.append(
torch.empty(self.session.get_static_shape(offset),
dtype=mlir_type_to_torch_dtype(
dtype=brt_dtype_to_torch_dtype(
self.session.get_data_type(offset)),
device=self.device))
return outputs
Expand Down
35 changes: 0 additions & 35 deletions tests/compatibilty_test/utils.py

This file was deleted.

0 comments on commit a2419af

Please sign in to comment.