Skip to content

Runtime error after expand op using Libtorch backend #2091

@wcshds

Description

@wcshds
use burn::{
    backend::{libtorch::LibTorchDevice, LibTorch},
    nn::EmbeddingConfig,
    tensor::{Int, Tensor},
};

fn main() {
    type Backend = LibTorch;
    let device = LibTorchDevice::Cpu;
    let positions: Tensor<Backend, 2, Int> = Tensor::arange(0..200, &device).expand([2, -1]);
    let embed = EmbeddingConfig::new(514, 256).init(&device);
    let res = embed.forward(positions + 2);
    println!("{res}");
}

QQ_1722642632521

This code works well on the NdArray backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions