Slide 67
Slide 67 text
assert ͷ༻ྫ
assert ෦తͳ߹ੑͷνΣοΫʹ͏
import TensorSwift
// 10000 ਓͷ྆खͷࢦͷ͞
let tensor = Tensor(shape: [10000, 2, 5], elements: ...)
// [ਓ, ࠨӈ, ࢦ] ͔Β [ࢦ, ਓ, ࠨӈ] ʹม
let transposed = tensor.transposed([2, 0, 1])
// ࠨखͷσʔλ͚ͩΛऔΓग़͢
let lefthand = tensor[..., ..., 1]
// [ࢦ, ਓ] ͷॱʹͳ͍ͬͯͯ΄͍͚͠Ͳॲཧ͕ෳࡶͰࣗ৴͕࣋ͯͳ͍ͷͰνΣοΫ
assert(lefthand.shape == [5, 10000])