You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mod.rs
    path of file: ./repos/dfdx/dfdx-core/src/tensor
    
    the code of the file until where you have to start completion: //! The [Tensor] struct, [Cpu] & [Cuda] devices, and
//! traits like [ZerosTensor], [OnesTensor], [SampleTensor].
//!
//! At a high level a tensor is made up of:
//! 1. The [crate::shapes::Shape] of the array it stores
//! 2. The [crate::shapes::Dtype] of the elements of the array
//! 3. The [Storage] (e.g. [Cpu] or [Cuda]) that it uses to store the nd array
//! 4. A [Tape], which can either actually be a tape ([OwnedTape])
//!    or be empty ([NoneTape]).
//!
//! Which are all generic parameters of [Tensor]. See the type's docstring for more info
//!
//! # Creating a device
//!
//
    
    fn test_lower_tri() {
        let dev: TestDevice = Default::default();
        let a: TestDtype = NumCast::from(42.0).unwrap();
        let z = TestDtype::zero();

        assert_eq!(dev.lower_tri::<Rank0>(a, None).array(), a);
        assert_eq!(dev.lower_tri::<Rank0>(a, -1).array(), z);
        assert_eq!(dev.lower_tri::<Rank1<3>>(a, None).array(), [a, z, z]);
        assert_eq!(dev.lower_tri::<Rank1<3>>(a, 1).array(), [a, a, z]);

        assert_eq!(
            dev.lower_tri::<Rank2<3, 4>>(a, None).array(),
            [[a, z, z, z], [a, a, z, z], [a, a, a, z]]
        );
        assert_eq!(
            dev.lower_tri::<Rank2<3, 1>>(a, None).array(),
            [[a], [a], [a]]
        );
        assert_eq!(dev.lower_tri::<Rank2<3, 1>>(a, 1).array(), [[a], [a], [a]]);
        assert_eq!(dev.lower_tri::<Rank2<3, 1>>(a, -1).array(), [[z], [a], [a]]);
        assert_eq!(
            dev.lower_tri::<Rank2<4, 4>>(a, -1).array(),
            [[z, z, z, z], [a, z, z, z], [a, a, z, z], [a, a, a, z]]
        );
        assert_eq!(
            dev.lower_tri::<Rank2<4, 4>>(a, -2).array(),
            [[z, z, z, z], [z, z, z, z], [a, z, z, z], [a, a, z, z]]
        );
        assert_eq!(
            dev.lower_tri::<Rank2<4, 3>>(a, 1).array(),
            [[a, a, z], [a, a, a], [a, a, a], [a, a, a]]
        );
        assert_eq!(
            dev.lower_tri::<Rank3<2, 5, 5>>(a, None).array(),
            [[
                [a, z, z, z, z],
                [a, a, z, z, z],
                [a, a, a, z, z],
                [a, a, a, a, z],
                [a, a, a, a, a]
            ]; 2]
        );
        assert_eq!(
            dev.lower_tri::<Rank3<4, 5, 5>>(a, 2).array(),
            [[
                [a, a, a, z, z],
                [a, a, a, a, z],
                [a, a, a, a, a],
                [a, a, a, a, a],
                [a, a, a, a, a]
            ]; 4]
        );
        assert_eq!(
            dev.lower_tri::<Rank4<3, 4, 5, 6>>(a, None).array(),
            [[[
                [a, z, z, z, z, z],
                [a, a, z, z, z, z],
                [a, a, a, z, z, z],
                [a, a, a, a, z, z],
                [a, a, a, a, a, z]
            ]; 4]; 3]
        );
    }