-
Notifications
You must be signed in to change notification settings - Fork 638
Open
Description
I was trying to build and run a pytorch based project code. But I'm facing some errors.
I'm attaching the code:
`
import torch
import torch_mlir
# Define a simple PyTorch model
class SimpleModel(torch.nn.Module):
def __init__(self):
super(SimpleModel, self).__init__()
self.linear = torch.nn.Linear(3, 2)
def forward(self, x):
return self.linear(x)
# Create an instance of the model
model = SimpleModel()
model.eval() # Set model to evaluation mode
# Create example input tensor
example_input = torch.randn(1, 3)
# Compile the model using Torch-MLIR
mlir_module = torch_mlir.compile(model, (example_input,), output_type="torch")
# Print the MLIR output
print(mlir_module)
`
I'm also attaching the error that i'm facing:
Traceback (most recent call last): File "/home/tos/COMPILER_PROJECT_DEC_2024/torch-mlir/sample.py", line 21, in <module> mlir_module = torch_mlir.compile(model, (example_input,), output_type="torch") ^^^^^^^^^^^^^^^^^^ AttributeError: module 'torch_mlir' has no attribute 'compile'
Can someone suggest me a solution to fix this issue ?
prakanth97, Kushagra-88, alphin-tosil, amemov and vfdff
Metadata
Metadata
Assignees
Labels
No labels