anyone know why I might be this error about TorchInputSpec:
use of unknown declaration 'TorchInputSpec'mojo from:
var session = engine.InferenceSession()
var model = session.load(
model_path,
input_specs = [
engine.TorchInputSpec(
shape=[none, 28, 28], dtype=DType.int32
),
],
)
I've got all the necessary imports, the ai bot is flummoxed
4 Replies
TorchInputSpec isn't in any module I can find, I think that is the problem.
The docs says it is in max.engine but the compiler disagrees
Congrats @Tony, you just advanced to level 3!
@kapa.ai Where is TorchInputSpec?
@kapa.ai where is TorchInputSpec
For Mojo API, to load a torchscript model please use https://docs.modular.com/max/api/mojo/engine/session/InputSpec
InputSpec | Modular Docs
Specifies a model's input shape and data type (required for TorchScript).