/
CoolTensors.jl
37 lines (27 loc) · 942 Bytes
/
CoolTensors.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module CoolTensors
# credits to @tkf on discourse: https://discourse.julialang.org/t/fun-one-liners/28352/57
@doc let path = joinpath(dirname(@__DIR__), "README.md")
include_dependency(path)
open(path) do io
lines = eachline(io)
# skip badges in lines 2-6
s = first(lines) * '\n' * join(Iterators.drop(lines, 5), '\n')
replace(s, "```julia" => "```jldoctest README")
end
end
CoolTensors
export Tensor, @T_str, raise, lower, TIndex, TI,
tbegin, tend
include("tensor.jl")
export TScalar, TVector, TCovector, TLinearMap, TBilinear
const TScalar = Tensor{T,0,T""} where {T}
const TVector = Tensor{T,1,T"'"} where {T}
const TCovector = Tensor{T,1,T","} where {T}
const TLinearMap = Tensor{T,2,T"',"} where {T}
const TBilinear = Tensor{T,2,T",,"} where {T}
include("contractions.jl")
include("tindex.jl")
include("tbeginend.jl")
export ⊗ # from TensorCore.jl
include("operations.jl")
end