README

Milky2018/minigpt/tensor does not have a README file

#
AutogradContext

pub struct AutogradContext {
// private fields
}

#
AutogradContext::AutogradContext

fn AutogradContext::AutogradContext() -> AutogradContext

#
AutogradContext::clear_graph

fn AutogradContext::clear_graph(self : AutogradContext) -> Unit

#
AutogradContext::zero_grad

fn AutogradContext::zero_grad(self : AutogradContext) -> Unit

#
Tensor

pub struct Tensor {
// private fields
}

impl Add for Tensor
impl Div for Tensor
impl Mul for Tensor
impl Neg for Tensor
impl Sub for Tensor

#
Tensor::add

fn Tensor::add(self : Tensor, that : Tensor) -> Tensor

#
Tensor::assign_parameter_data

fn Tensor::assign_parameter_data(self : Tensor, data : Array[Double]) -> Unit

#
Tensor::backward

fn Tensor::backward(self : Tensor) -> Unit

#
Tensor::cross_entropy

fn Tensor::cross_entropy(self : Tensor, targets : TokenIds) -> Tensor

#
Tensor::data

fn Tensor::data(self : Tensor) -> Array[Double]

#
Tensor::div

fn Tensor::div(self : Tensor, that : Tensor) -> Tensor

#
Tensor::exp

fn Tensor::exp(self : Tensor) -> Tensor

#
Tensor::from_array

fn Tensor::from_array(data : Array[Double], shape : Array[Int]) -> Tensor

#
Tensor::gather_rows

fn Tensor::gather_rows(self : Tensor, ids : TokenIds) -> Tensor

#
Tensor::gelu

fn Tensor::gelu(self : Tensor) -> Tensor

#
Tensor::grad

fn Tensor::grad(self : Tensor) -> Tensor?

#
Tensor::layer_norm

fn Tensor::layer_norm(self : Tensor, weight : Tensor, bias : Tensor, eps : Double) -> Tensor

#
Tensor::log

fn Tensor::log(self : Tensor) -> Tensor

#
Tensor::matmul

fn Tensor::matmul(self : Tensor, that : Tensor) -> Tensor

#
Tensor::mean

fn Tensor::mean(self : Tensor) -> Tensor

#
Tensor::mul

fn Tensor::mul(self : Tensor, that : Tensor) -> Tensor

#
Tensor::neg

fn Tensor::neg(self : Tensor) -> Tensor

#
Tensor::numel

fn Tensor::numel(self : Tensor) -> Int

#
Tensor::ones

fn Tensor::ones(shape : Array[Int]) -> Tensor

#
Tensor::parameter

fn Tensor::parameter(ctx : AutogradContext, data : Array[Double], shape : Array[Int]) -> Tensor

#
Tensor::randn

fn Tensor::randn(ctx : AutogradContext, shape : Array[Int], rng :
Rand
) -> Tensor

#
Tensor::relu

fn Tensor::relu(self : Tensor) -> Tensor

#
Tensor::requires_grad

fn Tensor::requires_grad(self : Tensor) -> Bool

#
Tensor::reshape

fn Tensor::reshape(self : Tensor, shape : Array[Int]) -> Tensor

#
Tensor::scalar

fn Tensor::scalar(value : Double) -> Tensor

#
Tensor::shape

fn Tensor::shape(self : Tensor) -> Array[Int]

#
Tensor::softmax

fn Tensor::softmax(self : Tensor, axis : Int) -> Tensor

#
Tensor::sub

fn Tensor::sub(self : Tensor, that : Tensor) -> Tensor

#
Tensor::sum

fn Tensor::sum(self : Tensor) -> Tensor

#
Tensor::swap_axes

fn Tensor::swap_axes(self : Tensor, axis_a : Int, axis_b : Int) -> Tensor

#
Tensor::transpose2d

fn Tensor::transpose2d(self : Tensor) -> Tensor

#
Tensor::zeros

fn Tensor::zeros(shape : Array[Int]) -> Tensor

#
TokenIds

pub struct TokenIds {
// private fields
}

#
TokenIds::TokenIds

fn TokenIds::TokenIds(data : Array[Int], shape : Array[Int]) -> TokenIds

#
TokenIds::data

fn TokenIds::data(self : TokenIds) -> Array[Int]

#
TokenIds::shape

fn TokenIds::shape(self : TokenIds) -> Array[Int]

#
check_grad

fn check_grad(values : Array[Double], shape : Array[Int], f : (Tensor) -> Tensor, eps? : Double, tol? : Double) -> Bool

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io