pub trait TryConcat<Rhs>: HasErr {
    type Output;

    // Required method
    fn try_concat(self, rhs: Rhs) -> Result<Self::Output, Self::Err>;

    // Provided method
    fn concat(self, rhs: Rhs) -> Self::Output { ... }
}
👎Deprecated: Use TryConcatAlong instead
Expand description

Concatenate two tensors along the first dimension.

Pytorch equivalent torch.concat.

Concat with const dims requires nightly:

let a: Tensor<Rank2<3, 4>, f32, _> = dev.zeros();
let b: Tensor<Rank2<3, 4>, f32, _> = dev.zeros();
let _: Tensor<Rank2<6, 4>, f32, _> = a.concat(b);

Concat with usize dims:

let a: Tensor<(usize, Const<3>), f32, _> = dev.zeros_like(&(2, Const));
let b: Tensor<(usize, Const<3>), f32, _> = dev.zeros_like(&(4, Const));
let c: Tensor<(usize, Const<3>), f32, _> = a.concat(b);
assert_eq!(c.shape().0, 6);

Required Associated Types§

source

type Output

👎Deprecated: Use TryConcatAlong instead

Required Methods§

source

fn try_concat(self, rhs: Rhs) -> Result<Self::Output, Self::Err>

👎Deprecated: Use TryConcatAlong::try_concat_along instead

Fallible version of TryConcat::concat.

Provided Methods§

source

fn concat(self, rhs: Rhs) -> Self::Output

👎Deprecated: Use TryConcatAlong::concat_along instead

Concatenate two tensors along the first dimension.

Implementors§

source§

impl<A, B: Shape, T, R, E: Dtype, D: ConcatKernel<E>> TryConcat<Tensor<B, E, D, R>> for Tensor<A, E, D, T>where A: ConcatShape<B> + Shape, T: Tape<E, D> + Merge<R>, R: Tape<E, D>,

§

type Output = Tensor<<A as ConcatShape<B>>::Catted, E, D, T>