torch.OpSchemas
export interface OpSchemas {
// ==========================================================================
// Binary Arithmetic Operations
// ==========================================================================
add: BinaryOpSchema<'add', BroadcastShapeRule, 'same'>;
sub: BinaryOpSchema<'sub', BroadcastShapeRule, 'same'>;
mul: BinaryOpSchema<'mul', BroadcastShapeRule, 'same'>;
div: BinaryOpSchema<'div', BroadcastShapeRule, 'same'>;
pow: BinaryOpSchema<'pow', BroadcastShapeRule, 'float'>;
float_power: BinaryOpSchema<'float_power', BroadcastShapeRule, 'float'>;
remainder: BinaryOpSchema<'remainder', BroadcastShapeRule, 'same'>;
fmod: BinaryOpSchema<'fmod', BroadcastShapeRule, 'float'>;
floor_divide: BinaryOpSchema<'floor_divide', BroadcastShapeRule, 'same'>;
// ==========================================================================
// Binary Min/Max Operations
// ==========================================================================
maximum: BinaryOpSchema<'maximum', BroadcastShapeRule, 'same'>;
minimum: BinaryOpSchema<'minimum', BroadcastShapeRule, 'same'>;
fmax: BinaryOpSchema<'fmax', BroadcastShapeRule, 'float'>;
fmin: BinaryOpSchema<'fmin', BroadcastShapeRule, 'float'>;
// ==========================================================================
// Binary Trigonometric Operations
// ==========================================================================
atan2: BinaryOpSchema<'atan2', BroadcastShapeRule, 'float'>;
hypot: BinaryOpSchema<'hypot', BroadcastShapeRule, 'float'>;
// ==========================================================================
// Binary Special Operations
// ==========================================================================
copysign: BinaryOpSchema<'copysign', BroadcastShapeRule, 'float'>;
logaddexp: BinaryOpSchema<'logaddexp', BroadcastShapeRule, 'float'>;
logaddexp2: BinaryOpSchema<'logaddexp2', BroadcastShapeRule, 'float'>;
xlogy: BinaryOpSchema<'xlogy', BroadcastShapeRule, 'float'>;
ldexp: BinaryOpSchema<'ldexp', BroadcastShapeRule, 'float'>;
nextafter: BinaryOpSchema<'nextafter', BroadcastShapeRule, 'float'>;
// ==========================================================================
// Binary Bitwise Operations
// ==========================================================================
bitwise_and: BinaryOpSchema<'bitwise_and', BroadcastShapeRule, 'same'>;
bitwise_or: BinaryOpSchema<'bitwise_or', BroadcastShapeRule, 'same'>;
bitwise_xor: BinaryOpSchema<'bitwise_xor', BroadcastShapeRule, 'same'>;
bitwise_left_shift: BinaryOpSchema<'bitwise_left_shift', BroadcastShapeRule, 'same'>;
bitwise_right_shift: BinaryOpSchema<'bitwise_right_shift', BroadcastShapeRule, 'same'>;
// ==========================================================================
// Binary Logical Operations
// ==========================================================================
logical_and: BinaryOpSchema<'logical_and', BroadcastShapeRule, 'boolean'>;
logical_or: BinaryOpSchema<'logical_or', BroadcastShapeRule, 'boolean'>;
logical_xor: BinaryOpSchema<'logical_xor', BroadcastShapeRule, 'boolean'>;
// ==========================================================================
// Binary Integer Operations
// ==========================================================================
gcd: BinaryOpSchema<'gcd', BroadcastShapeRule, 'same'>;
lcm: BinaryOpSchema<'lcm', BroadcastShapeRule, 'same'>;
// ==========================================================================
// Binary Comparison Operations
// ==========================================================================
eq: BinaryOpSchema<'eq', BroadcastShapeRule, 'boolean'>;
ne: BinaryOpSchema<'ne', BroadcastShapeRule, 'boolean'>;
lt: BinaryOpSchema<'lt', BroadcastShapeRule, 'boolean'>;
le: BinaryOpSchema<'le', BroadcastShapeRule, 'boolean'>;
gt: BinaryOpSchema<'gt', BroadcastShapeRule, 'boolean'>;
ge: BinaryOpSchema<'ge', BroadcastShapeRule, 'boolean'>;
// ==========================================================================
// Matrix Multiplication Operations
// ==========================================================================
matmul: BinaryOpSchema<'matmul', MatmulShapeRule, 'same'>;
mm: BinaryOpSchema<'mm', MMShapeRule, 'same'>;
bmm: BinaryOpSchema<'bmm', MatmulShapeRule, 'same'>;
dot: BinaryOpSchema<'dot', 'dot', 'same'>;
mv: BinaryOpSchema<'mv', 'mv', 'same'>;
// ==========================================================================
// Unary Basic Operations
// ==========================================================================
neg: UnaryOpSchema<'neg', IdentityShape, 'same'>;
abs: UnaryOpSchema<'abs', IdentityShape, 'same'>;
sign: UnaryOpSchema<'sign', IdentityShape, 'same'>;
positive: UnaryOpSchema<'positive', IdentityShape, 'same'>;
square: UnaryOpSchema<'square', IdentityShape, 'same'>;
reciprocal: UnaryOpSchema<'reciprocal', IdentityShape, 'float'>;
// ==========================================================================
// Unary Rounding Operations
// ==========================================================================
ceil: UnaryOpSchema<'ceil', IdentityShape, 'float'>;
floor: UnaryOpSchema<'floor', IdentityShape, 'float'>;
round: UnaryOpSchema<'round', IdentityShape, 'float'>;
trunc: UnaryOpSchema<'trunc', IdentityShape, 'float'>;
frac: UnaryOpSchema<'frac', IdentityShape, 'float'>;
// ==========================================================================
// Unary Exponential and Logarithmic Operations
// ==========================================================================
exp: UnaryOpSchema<'exp', IdentityShape, 'float'>;
exp2: UnaryOpSchema<'exp2', IdentityShape, 'float'>;
expm1: UnaryOpSchema<'expm1', IdentityShape, 'float'>;
log: UnaryOpSchema<'log', IdentityShape, 'float'>;
log2: UnaryOpSchema<'log2', IdentityShape, 'float'>;
log10: UnaryOpSchema<'log10', IdentityShape, 'float'>;
log1p: UnaryOpSchema<'log1p', IdentityShape, 'float'>;
sqrt: UnaryOpSchema<'sqrt', IdentityShape, 'float'>;
rsqrt: UnaryOpSchema<'rsqrt', IdentityShape, 'float'>;
// ==========================================================================
// Unary Trigonometric Operations
// ==========================================================================
sin: UnaryOpSchema<'sin', IdentityShape, 'float'>;
cos: UnaryOpSchema<'cos', IdentityShape, 'float'>;
tan: UnaryOpSchema<'tan', IdentityShape, 'float'>;
asin: UnaryOpSchema<'asin', IdentityShape, 'float'>;
acos: UnaryOpSchema<'acos', IdentityShape, 'float'>;
atan: UnaryOpSchema<'atan', IdentityShape, 'float'>;
// ==========================================================================
// Unary Hyperbolic Operations
// ==========================================================================
sinh: UnaryOpSchema<'sinh', IdentityShape, 'float'>;
cosh: UnaryOpSchema<'cosh', IdentityShape, 'float'>;
asinh: UnaryOpSchema<'asinh', IdentityShape, 'float'>;
acosh: UnaryOpSchema<'acosh', IdentityShape, 'float'>;
atanh: UnaryOpSchema<'atanh', IdentityShape, 'float'>;
// ==========================================================================
// Unary Activation Functions
// ==========================================================================
relu: UnaryOpSchema<'relu', IdentityShape, 'same'>;
prelu: BinaryOpSchema<'prelu', BroadcastShapeRule, 'same'>;
elu: UnaryOpSchema<'elu', IdentityShape, 'float'>;
celu: UnaryOpSchema<'celu', IdentityShape, 'float'>;
selu: UnaryOpSchema<'selu', IdentityShape, 'float'>;
leaky_relu: UnaryOpSchema<'leaky_relu', IdentityShape, 'float'>;
rrelu: UnaryOpSchema<'rrelu', IdentityShape, 'float'>;
sigmoid: UnaryOpSchema<'sigmoid', IdentityShape, 'float'>;
logsigmoid: UnaryOpSchema<'logsigmoid', IdentityShape, 'float'>;
tanh: UnaryOpSchema<'tanh', IdentityShape, 'float'>;
gelu: UnaryOpSchema<'gelu', IdentityShape, 'float'>;
glu: UnaryOpSchema<'glu', IdentityShape, 'same'>;
silu: UnaryOpSchema<'silu', IdentityShape, 'float'>;
mish: UnaryOpSchema<'mish', IdentityShape, 'float'>;
hardsigmoid: UnaryOpSchema<'hardsigmoid', IdentityShape, 'float'>;
hardswish: UnaryOpSchema<'hardswish', IdentityShape, 'float'>;
hardtanh: UnaryOpSchema<'hardtanh', IdentityShape, 'float'>;
hardshrink: UnaryOpSchema<'hardshrink', IdentityShape, 'float'>;
softshrink: UnaryOpSchema<'softshrink', IdentityShape, 'float'>;
softmin: UnaryOpSchema<'softmin', IdentityShape, 'float'>;
softplus: UnaryOpSchema<'softplus', IdentityShape, 'float'>;
softsign: UnaryOpSchema<'softsign', IdentityShape, 'float'>;
tanhshrink: UnaryOpSchema<'tanhshrink', IdentityShape, 'float'>;
relu6: UnaryOpSchema<'relu6', IdentityShape, 'same'>;
threshold: UnaryOpSchema<'threshold', IdentityShape, 'same'>;
erf: UnaryOpSchema<'erf', IdentityShape, 'float'>;
erfc: UnaryOpSchema<'erfc', IdentityShape, 'float'>;
erfinv: UnaryOpSchema<'erfinv', IdentityShape, 'float'>;
lgamma: UnaryOpSchema<'lgamma', IdentityShape, 'float'>;
digamma: UnaryOpSchema<'digamma', IdentityShape, 'float'>;
i0: UnaryOpSchema<'i0', IdentityShape, 'float'>;
logit: UnaryOpSchema<'logit', IdentityShape, 'float'>;
sinc: UnaryOpSchema<'sinc', IdentityShape, 'float'>;
// ==========================================================================
// Unary Conversion Operations
// ==========================================================================
deg2rad: UnaryOpSchema<'deg2rad', IdentityShape, 'float'>;
rad2deg: UnaryOpSchema<'rad2deg', IdentityShape, 'float'>;
// ==========================================================================
// Unary Bitwise Operations
// ==========================================================================
bitwise_not: UnaryOpSchema<'bitwise_not', IdentityShape, 'same'>;
// ==========================================================================
// Unary Logical Operations
// ==========================================================================
logical_not: UnaryOpSchema<'logical_not', IdentityShape, 'boolean'>;
// ==========================================================================
// Unary Type Checking Operations
// ==========================================================================
isnan: UnaryOpSchema<'isnan', IdentityShape, 'boolean'>;
isinf: UnaryOpSchema<'isinf', IdentityShape, 'boolean'>;
isfinite: UnaryOpSchema<'isfinite', IdentityShape, 'boolean'>;
isposinf: UnaryOpSchema<'isposinf', IdentityShape, 'boolean'>;
isneginf: UnaryOpSchema<'isneginf', IdentityShape, 'boolean'>;
signbit: UnaryOpSchema<'signbit', IdentityShape, 'boolean'>;
isreal: UnaryOpSchema<'isreal', IdentityShape, 'boolean'>;
// ==========================================================================
// Reduction Operations
// ==========================================================================
sum: ReductionOpSchema<'sum', 'same'>;
prod: ReductionOpSchema<'prod', 'same'>;
mean: ReductionOpSchema<'mean', 'float'>;
std: ReductionOpSchema<'std', 'float'>;
var: ReductionOpSchema<'var', 'float'>;
max: ReductionOpSchema<'max', 'same'>;
min: ReductionOpSchema<'min', 'same'>;
amax: ReductionOpSchema<'amax', 'same'>;
amin: ReductionOpSchema<'amin', 'same'>;
argmax: ReductionOpSchema<'argmax', 'same'>;
argmin: ReductionOpSchema<'argmin', 'same'>;
any: ReductionOpSchema<'any', 'boolean'>;
all: ReductionOpSchema<'all', 'boolean'>;
logsumexp: ReductionOpSchema<'logsumexp', 'float'>;
norm: ReductionOpSchema<'norm', 'float'>;
// ==========================================================================
// Creation Operations
// ==========================================================================
zeros: CreationOpSchema<'zeros'>;
ones: CreationOpSchema<'ones'>;
empty: CreationOpSchema<'empty'>;
full: CreationOpSchema<'full'>;
arange: CreationOpSchema<'arange'>;
linspace: CreationOpSchema<'linspace'>;
logspace: CreationOpSchema<'logspace'>;
eye: CreationOpSchema<'eye'>;
rand: CreationOpSchema<'rand'>;
randn: CreationOpSchema<'randn'>;
randint: CreationOpSchema<'randint'>;
// ==========================================================================
// Shape Operations
// ==========================================================================
reshape: ShapeOpSchema<'reshape'>;
view: ShapeOpSchema<'view'>;
transpose: ShapeOpSchema<'transpose'>;
permute: ShapeOpSchema<'permute'>;
squeeze: ShapeOpSchema<'squeeze'>;
unsqueeze: ShapeOpSchema<'unsqueeze'>;
flatten: ShapeOpSchema<'flatten'>;
expand: ShapeOpSchema<'expand'>;
contiguous: ShapeOpSchema<'contiguous'>;
clone: ShapeOpSchema<'clone'>;
t: ShapeOpSchema<'t'>;
masked_fill: ShapeOpSchema<'masked_fill'>;
// ==========================================================================
// torch.special.* Namespace Operations
// ==========================================================================
'special.expm1': UnaryOpSchema<'special.expm1', IdentityShape, 'float'>;
'special.exp2': UnaryOpSchema<'special.exp2', IdentityShape, 'float'>;
'special.log1p': UnaryOpSchema<'special.log1p', IdentityShape, 'float'>;
'special.xlogy': BinaryOpSchema<'special.xlogy', BroadcastShapeRule, 'float'>;
'special.erf': UnaryOpSchema<'special.erf', IdentityShape, 'float'>;
'special.erfc': UnaryOpSchema<'special.erfc', IdentityShape, 'float'>;
'special.erfinv': UnaryOpSchema<'special.erfinv', IdentityShape, 'float'>;
'special.i0': UnaryOpSchema<'special.i0', IdentityShape, 'float'>;
'special.i0e': UnaryOpSchema<'special.i0e', IdentityShape, 'float'>;
'special.i1': UnaryOpSchema<'special.i1', IdentityShape, 'float'>;
'special.i1e': UnaryOpSchema<'special.i1e', IdentityShape, 'float'>;
'special.logit': UnaryOpSchema<'special.logit', IdentityShape, 'float'>;
'special.expit': UnaryOpSchema<'special.expit', IdentityShape, 'float'>;
'special.digamma': UnaryOpSchema<'special.digamma', IdentityShape, 'float'>;
'special.gammaln': UnaryOpSchema<'special.gammaln', IdentityShape, 'float'>;
'special.entr': UnaryOpSchema<'special.entr', IdentityShape, 'float'>;
'special.xlog1py': BinaryOpSchema<'special.xlog1py', BroadcastShapeRule, 'float'>;
'special.zeta': BinaryOpSchema<'special.zeta', BroadcastShapeRule, 'float'>;
'special.ndtr': UnaryOpSchema<'special.ndtr', IdentityShape, 'float'>;
'special.ndtri': UnaryOpSchema<'special.ndtri', IdentityShape, 'float'>;
'special.log_ndtr': UnaryOpSchema<'special.log_ndtr', IdentityShape, 'float'>;
'special.sinc': UnaryOpSchema<'special.sinc', IdentityShape, 'float'>;
'special.round': UnaryOpSchema<'special.round', IdentityShape, 'float'>;
// ==========================================================================
// torch.nn.functional.* Namespace Operations
// ==========================================================================
'nn.functional.relu': UnaryOpSchema<'nn.functional.relu', IdentityShape, 'same'>;
'nn.functional.prelu': BinaryOpSchema<'nn.functional.prelu', BroadcastShapeRule, 'same'>;
'nn.functional.leaky_relu': UnaryOpSchema<
'nn.functional.leaky_relu',
IdentityShape,
'float',
{ negative_slope?: number }
>;
'nn.functional.rrelu': UnaryOpSchema<
'nn.functional.rrelu',
IdentityShape,
'float',
{ lower?: number; upper?: number; slope?: number }
>;
'nn.functional.softmin': UnaryOpSchema<
'nn.functional.softmin',
IdentityShape,
'float',
{ dim?: number }
>;
'nn.functional.sigmoid': UnaryOpSchema<'nn.functional.sigmoid', IdentityShape, 'float'>;
'nn.functional.logsigmoid': UnaryOpSchema<'nn.functional.logsigmoid', IdentityShape, 'float'>;
'nn.functional.tanh': UnaryOpSchema<'nn.functional.tanh', IdentityShape, 'float'>;
'nn.functional.gelu': UnaryOpSchema<'nn.functional.gelu', IdentityShape, 'float'>;
'nn.functional.glu': UnaryOpSchema<'nn.functional.glu', IdentityShape, 'same', { dim?: number }>;
'nn.functional.silu': UnaryOpSchema<'nn.functional.silu', IdentityShape, 'float'>;
'nn.functional.mish': UnaryOpSchema<'nn.functional.mish', IdentityShape, 'float'>;
'nn.functional.hardsigmoid': UnaryOpSchema<'nn.functional.hardsigmoid', IdentityShape, 'float'>;
'nn.functional.hardswish': UnaryOpSchema<'nn.functional.hardswish', IdentityShape, 'float'>;
'nn.functional.hardtanh': UnaryOpSchema<
'nn.functional.hardtanh',
IdentityShape,
'float',
{ min_val?: number; max_val?: number }
>;
'nn.functional.hardshrink': UnaryOpSchema<
'nn.functional.hardshrink',
IdentityShape,
'float',
{ lambd?: number }
>;
'nn.functional.softshrink': UnaryOpSchema<
'nn.functional.softshrink',
IdentityShape,
'float',
{ lambd?: number }
>;
'nn.functional.softplus': UnaryOpSchema<
'nn.functional.softplus',
IdentityShape,
'float',
{ beta?: number; threshold?: number }
>;
'nn.functional.softsign': UnaryOpSchema<'nn.functional.softsign', IdentityShape, 'float'>;
'nn.functional.tanhshrink': UnaryOpSchema<'nn.functional.tanhshrink', IdentityShape, 'float'>;
'nn.functional.elu': UnaryOpSchema<
'nn.functional.elu',
IdentityShape,
'float',
{ alpha?: number }
>;
'nn.functional.celu': UnaryOpSchema<
'nn.functional.celu',
IdentityShape,
'float',
{ alpha?: number }
>;
'nn.functional.selu': UnaryOpSchema<'nn.functional.selu', IdentityShape, 'float'>;
'nn.functional.relu6': UnaryOpSchema<'nn.functional.relu6', IdentityShape, 'same'>;
'nn.functional.threshold': UnaryOpSchema<
'nn.functional.threshold',
IdentityShape,
'same',
{ threshold?: number; value?: number }
>;
'nn.functional.softmax': UnaryOpSchema<
'nn.functional.softmax',
IdentityShape,
'float',
{ dim?: number }
>;
'nn.functional.log_softmax': UnaryOpSchema<
'nn.functional.log_softmax',
IdentityShape,
'float',
{ dim?: number }
>;
'nn.functional.dropout': UnaryOpSchema<
'nn.functional.dropout',
IdentityShape,
'same',
{ p?: number; training?: boolean }
>;
'nn.functional.linear': BinaryOpSchema<'nn.functional.linear', 'matmul', 'same'>;
}add(BinaryOpSchema<'add', BroadcastShapeRule, 'same'>)sub(BinaryOpSchema<'sub', BroadcastShapeRule, 'same'>)mul(BinaryOpSchema<'mul', BroadcastShapeRule, 'same'>)div(BinaryOpSchema<'div', BroadcastShapeRule, 'same'>)pow(BinaryOpSchema<'pow', BroadcastShapeRule, 'float'>)float_power(BinaryOpSchema<'float_power', BroadcastShapeRule, 'float'>)remainder(BinaryOpSchema<'remainder', BroadcastShapeRule, 'same'>)fmod(BinaryOpSchema<'fmod', BroadcastShapeRule, 'float'>)floor_divide(BinaryOpSchema<'floor_divide', BroadcastShapeRule, 'same'>)maximum(BinaryOpSchema<'maximum', BroadcastShapeRule, 'same'>)minimum(BinaryOpSchema<'minimum', BroadcastShapeRule, 'same'>)fmax(BinaryOpSchema<'fmax', BroadcastShapeRule, 'float'>)fmin(BinaryOpSchema<'fmin', BroadcastShapeRule, 'float'>)atan2(BinaryOpSchema<'atan2', BroadcastShapeRule, 'float'>)hypot(BinaryOpSchema<'hypot', BroadcastShapeRule, 'float'>)copysign(BinaryOpSchema<'copysign', BroadcastShapeRule, 'float'>)logaddexp(BinaryOpSchema<'logaddexp', BroadcastShapeRule, 'float'>)logaddexp2(BinaryOpSchema<'logaddexp2', BroadcastShapeRule, 'float'>)xlogy(BinaryOpSchema<'xlogy', BroadcastShapeRule, 'float'>)ldexp(BinaryOpSchema<'ldexp', BroadcastShapeRule, 'float'>)nextafter(BinaryOpSchema<'nextafter', BroadcastShapeRule, 'float'>)bitwise_and(BinaryOpSchema<'bitwise_and', BroadcastShapeRule, 'same'>)bitwise_or(BinaryOpSchema<'bitwise_or', BroadcastShapeRule, 'same'>)bitwise_xor(BinaryOpSchema<'bitwise_xor', BroadcastShapeRule, 'same'>)bitwise_left_shift(BinaryOpSchema<'bitwise_left_shift', BroadcastShapeRule, 'same'>)bitwise_right_shift(BinaryOpSchema<'bitwise_right_shift', BroadcastShapeRule, 'same'>)logical_and(BinaryOpSchema<'logical_and', BroadcastShapeRule, 'boolean'>)logical_or(BinaryOpSchema<'logical_or', BroadcastShapeRule, 'boolean'>)logical_xor(BinaryOpSchema<'logical_xor', BroadcastShapeRule, 'boolean'>)gcd(BinaryOpSchema<'gcd', BroadcastShapeRule, 'same'>)lcm(BinaryOpSchema<'lcm', BroadcastShapeRule, 'same'>)eq(BinaryOpSchema<'eq', BroadcastShapeRule, 'boolean'>)ne(BinaryOpSchema<'ne', BroadcastShapeRule, 'boolean'>)lt(BinaryOpSchema<'lt', BroadcastShapeRule, 'boolean'>)le(BinaryOpSchema<'le', BroadcastShapeRule, 'boolean'>)gt(BinaryOpSchema<'gt', BroadcastShapeRule, 'boolean'>)ge(BinaryOpSchema<'ge', BroadcastShapeRule, 'boolean'>)matmul(BinaryOpSchema<'matmul', MatmulShapeRule, 'same'>)mm(BinaryOpSchema<'mm', MMShapeRule, 'same'>)bmm(BinaryOpSchema<'bmm', MatmulShapeRule, 'same'>)dot(BinaryOpSchema<'dot', 'dot', 'same'>)mv(BinaryOpSchema<'mv', 'mv', 'same'>)neg(UnaryOpSchema<'neg', IdentityShape, 'same'>)abs(UnaryOpSchema<'abs', IdentityShape, 'same'>)sign(UnaryOpSchema<'sign', IdentityShape, 'same'>)positive(UnaryOpSchema<'positive', IdentityShape, 'same'>)square(UnaryOpSchema<'square', IdentityShape, 'same'>)reciprocal(UnaryOpSchema<'reciprocal', IdentityShape, 'float'>)ceil(UnaryOpSchema<'ceil', IdentityShape, 'float'>)floor(UnaryOpSchema<'floor', IdentityShape, 'float'>)round(UnaryOpSchema<'round', IdentityShape, 'float'>)trunc(UnaryOpSchema<'trunc', IdentityShape, 'float'>)frac(UnaryOpSchema<'frac', IdentityShape, 'float'>)exp(UnaryOpSchema<'exp', IdentityShape, 'float'>)exp2(UnaryOpSchema<'exp2', IdentityShape, 'float'>)expm1(UnaryOpSchema<'expm1', IdentityShape, 'float'>)log(UnaryOpSchema<'log', IdentityShape, 'float'>)log2(UnaryOpSchema<'log2', IdentityShape, 'float'>)log10(UnaryOpSchema<'log10', IdentityShape, 'float'>)log1p(UnaryOpSchema<'log1p', IdentityShape, 'float'>)sqrt(UnaryOpSchema<'sqrt', IdentityShape, 'float'>)rsqrt(UnaryOpSchema<'rsqrt', IdentityShape, 'float'>)sin(UnaryOpSchema<'sin', IdentityShape, 'float'>)cos(UnaryOpSchema<'cos', IdentityShape, 'float'>)tan(UnaryOpSchema<'tan', IdentityShape, 'float'>)asin(UnaryOpSchema<'asin', IdentityShape, 'float'>)acos(UnaryOpSchema<'acos', IdentityShape, 'float'>)atan(UnaryOpSchema<'atan', IdentityShape, 'float'>)sinh(UnaryOpSchema<'sinh', IdentityShape, 'float'>)cosh(UnaryOpSchema<'cosh', IdentityShape, 'float'>)asinh(UnaryOpSchema<'asinh', IdentityShape, 'float'>)acosh(UnaryOpSchema<'acosh', IdentityShape, 'float'>)atanh(UnaryOpSchema<'atanh', IdentityShape, 'float'>)relu(UnaryOpSchema<'relu', IdentityShape, 'same'>)prelu(BinaryOpSchema<'prelu', BroadcastShapeRule, 'same'>)elu(UnaryOpSchema<'elu', IdentityShape, 'float'>)celu(UnaryOpSchema<'celu', IdentityShape, 'float'>)selu(UnaryOpSchema<'selu', IdentityShape, 'float'>)leaky_relu(UnaryOpSchema<'leaky_relu', IdentityShape, 'float'>)rrelu(UnaryOpSchema<'rrelu', IdentityShape, 'float'>)sigmoid(UnaryOpSchema<'sigmoid', IdentityShape, 'float'>)logsigmoid(UnaryOpSchema<'logsigmoid', IdentityShape, 'float'>)tanh(UnaryOpSchema<'tanh', IdentityShape, 'float'>)gelu(UnaryOpSchema<'gelu', IdentityShape, 'float'>)glu(UnaryOpSchema<'glu', IdentityShape, 'same'>)silu(UnaryOpSchema<'silu', IdentityShape, 'float'>)mish(UnaryOpSchema<'mish', IdentityShape, 'float'>)hardsigmoid(UnaryOpSchema<'hardsigmoid', IdentityShape, 'float'>)hardswish(UnaryOpSchema<'hardswish', IdentityShape, 'float'>)hardtanh(UnaryOpSchema<'hardtanh', IdentityShape, 'float'>)hardshrink(UnaryOpSchema<'hardshrink', IdentityShape, 'float'>)softshrink(UnaryOpSchema<'softshrink', IdentityShape, 'float'>)softmin(UnaryOpSchema<'softmin', IdentityShape, 'float'>)softplus(UnaryOpSchema<'softplus', IdentityShape, 'float'>)softsign(UnaryOpSchema<'softsign', IdentityShape, 'float'>)tanhshrink(UnaryOpSchema<'tanhshrink', IdentityShape, 'float'>)relu6(UnaryOpSchema<'relu6', IdentityShape, 'same'>)threshold(UnaryOpSchema<'threshold', IdentityShape, 'same'>)erf(UnaryOpSchema<'erf', IdentityShape, 'float'>)erfc(UnaryOpSchema<'erfc', IdentityShape, 'float'>)erfinv(UnaryOpSchema<'erfinv', IdentityShape, 'float'>)lgamma(UnaryOpSchema<'lgamma', IdentityShape, 'float'>)digamma(UnaryOpSchema<'digamma', IdentityShape, 'float'>)i0(UnaryOpSchema<'i0', IdentityShape, 'float'>)logit(UnaryOpSchema<'logit', IdentityShape, 'float'>)sinc(UnaryOpSchema<'sinc', IdentityShape, 'float'>)deg2rad(UnaryOpSchema<'deg2rad', IdentityShape, 'float'>)rad2deg(UnaryOpSchema<'rad2deg', IdentityShape, 'float'>)bitwise_not(UnaryOpSchema<'bitwise_not', IdentityShape, 'same'>)logical_not(UnaryOpSchema<'logical_not', IdentityShape, 'boolean'>)isnan(UnaryOpSchema<'isnan', IdentityShape, 'boolean'>)isinf(UnaryOpSchema<'isinf', IdentityShape, 'boolean'>)isfinite(UnaryOpSchema<'isfinite', IdentityShape, 'boolean'>)isposinf(UnaryOpSchema<'isposinf', IdentityShape, 'boolean'>)isneginf(UnaryOpSchema<'isneginf', IdentityShape, 'boolean'>)signbit(UnaryOpSchema<'signbit', IdentityShape, 'boolean'>)isreal(UnaryOpSchema<'isreal', IdentityShape, 'boolean'>)sum(ReductionOpSchema<'sum', 'same'>)prod(ReductionOpSchema<'prod', 'same'>)mean(ReductionOpSchema<'mean', 'float'>)std(ReductionOpSchema<'std', 'float'>)var(ReductionOpSchema<'var', 'float'>)max(ReductionOpSchema<'max', 'same'>)min(ReductionOpSchema<'min', 'same'>)amax(ReductionOpSchema<'amax', 'same'>)amin(ReductionOpSchema<'amin', 'same'>)argmax(ReductionOpSchema<'argmax', 'same'>)argmin(ReductionOpSchema<'argmin', 'same'>)any(ReductionOpSchema<'any', 'boolean'>)all(ReductionOpSchema<'all', 'boolean'>)logsumexp(ReductionOpSchema<'logsumexp', 'float'>)norm(ReductionOpSchema<'norm', 'float'>)zeros(CreationOpSchema<'zeros'>)ones(CreationOpSchema<'ones'>)empty(CreationOpSchema<'empty'>)full(CreationOpSchema<'full'>)arange(CreationOpSchema<'arange'>)linspace(CreationOpSchema<'linspace'>)logspace(CreationOpSchema<'logspace'>)eye(CreationOpSchema<'eye'>)rand(CreationOpSchema<'rand'>)randn(CreationOpSchema<'randn'>)randint(CreationOpSchema<'randint'>)reshape(ShapeOpSchema<'reshape'>)view(ShapeOpSchema<'view'>)transpose(ShapeOpSchema<'transpose'>)permute(ShapeOpSchema<'permute'>)squeeze(ShapeOpSchema<'squeeze'>)unsqueeze(ShapeOpSchema<'unsqueeze'>)flatten(ShapeOpSchema<'flatten'>)expand(ShapeOpSchema<'expand'>)contiguous(ShapeOpSchema<'contiguous'>)clone(ShapeOpSchema<'clone'>)t(ShapeOpSchema<'t'>)masked_fill(ShapeOpSchema<'masked_fill'>)'special.expm1'(UnaryOpSchema<'special.expm1', IdentityShape, 'float'>)'special.exp2'(UnaryOpSchema<'special.exp2', IdentityShape, 'float'>)'special.log1p'(UnaryOpSchema<'special.log1p', IdentityShape, 'float'>)'special.xlogy'(BinaryOpSchema<'special.xlogy', BroadcastShapeRule, 'float'>)'special.erf'(UnaryOpSchema<'special.erf', IdentityShape, 'float'>)'special.erfc'(UnaryOpSchema<'special.erfc', IdentityShape, 'float'>)'special.erfinv'(UnaryOpSchema<'special.erfinv', IdentityShape, 'float'>)'special.i0'(UnaryOpSchema<'special.i0', IdentityShape, 'float'>)'special.i0e'(UnaryOpSchema<'special.i0e', IdentityShape, 'float'>)'special.i1'(UnaryOpSchema<'special.i1', IdentityShape, 'float'>)'special.i1e'(UnaryOpSchema<'special.i1e', IdentityShape, 'float'>)'special.logit'(UnaryOpSchema<'special.logit', IdentityShape, 'float'>)'special.expit'(UnaryOpSchema<'special.expit', IdentityShape, 'float'>)'special.digamma'(UnaryOpSchema<'special.digamma', IdentityShape, 'float'>)'special.gammaln'(UnaryOpSchema<'special.gammaln', IdentityShape, 'float'>)'special.entr'(UnaryOpSchema<'special.entr', IdentityShape, 'float'>)'special.xlog1py'(BinaryOpSchema<'special.xlog1py', BroadcastShapeRule, 'float'>)'special.zeta'(BinaryOpSchema<'special.zeta', BroadcastShapeRule, 'float'>)'special.ndtr'(UnaryOpSchema<'special.ndtr', IdentityShape, 'float'>)'special.ndtri'(UnaryOpSchema<'special.ndtri', IdentityShape, 'float'>)'special.log_ndtr'(UnaryOpSchema<'special.log_ndtr', IdentityShape, 'float'>)'special.sinc'(UnaryOpSchema<'special.sinc', IdentityShape, 'float'>)'special.round'(UnaryOpSchema<'special.round', IdentityShape, 'float'>)'nn.functional.relu'(UnaryOpSchema<'nn.functional.relu', IdentityShape, 'same'>)'nn.functional.prelu'(BinaryOpSchema<'nn.functional.prelu', BroadcastShapeRule, 'same'>)'nn.functional.leaky_relu'(UnaryOpSchema< 'nn.functional.leaky_relu', IdentityShape, 'float', { negative_slope?: number } >)'nn.functional.rrelu'(UnaryOpSchema< 'nn.functional.rrelu', IdentityShape, 'float', { lower?: number; upper?: number; slope?: number } >)'nn.functional.softmin'(UnaryOpSchema< 'nn.functional.softmin', IdentityShape, 'float', { dim?: number } >)'nn.functional.sigmoid'(UnaryOpSchema<'nn.functional.sigmoid', IdentityShape, 'float'>)'nn.functional.logsigmoid'(UnaryOpSchema<'nn.functional.logsigmoid', IdentityShape, 'float'>)'nn.functional.tanh'(UnaryOpSchema<'nn.functional.tanh', IdentityShape, 'float'>)'nn.functional.gelu'(UnaryOpSchema<'nn.functional.gelu', IdentityShape, 'float'>)'nn.functional.glu'(UnaryOpSchema<'nn.functional.glu', IdentityShape, 'same', { dim?: number }>)'nn.functional.silu'(UnaryOpSchema<'nn.functional.silu', IdentityShape, 'float'>)'nn.functional.mish'(UnaryOpSchema<'nn.functional.mish', IdentityShape, 'float'>)'nn.functional.hardsigmoid'(UnaryOpSchema<'nn.functional.hardsigmoid', IdentityShape, 'float'>)'nn.functional.hardswish'(UnaryOpSchema<'nn.functional.hardswish', IdentityShape, 'float'>)'nn.functional.hardtanh'(UnaryOpSchema< 'nn.functional.hardtanh', IdentityShape, 'float', { min_val?: number; max_val?: number } >)'nn.functional.hardshrink'(UnaryOpSchema< 'nn.functional.hardshrink', IdentityShape, 'float', { lambd?: number } >)'nn.functional.softshrink'(UnaryOpSchema< 'nn.functional.softshrink', IdentityShape, 'float', { lambd?: number } >)'nn.functional.softplus'(UnaryOpSchema< 'nn.functional.softplus', IdentityShape, 'float', { beta?: number; threshold?: number } >)'nn.functional.softsign'(UnaryOpSchema<'nn.functional.softsign', IdentityShape, 'float'>)'nn.functional.tanhshrink'(UnaryOpSchema<'nn.functional.tanhshrink', IdentityShape, 'float'>)'nn.functional.elu'(UnaryOpSchema< 'nn.functional.elu', IdentityShape, 'float', { alpha?: number } >)'nn.functional.celu'(UnaryOpSchema< 'nn.functional.celu', IdentityShape, 'float', { alpha?: number } >)'nn.functional.selu'(UnaryOpSchema<'nn.functional.selu', IdentityShape, 'float'>)'nn.functional.relu6'(UnaryOpSchema<'nn.functional.relu6', IdentityShape, 'same'>)'nn.functional.threshold'(UnaryOpSchema< 'nn.functional.threshold', IdentityShape, 'same', { threshold?: number; value?: number } >)'nn.functional.softmax'(UnaryOpSchema< 'nn.functional.softmax', IdentityShape, 'float', { dim?: number } >)'nn.functional.log_softmax'(UnaryOpSchema< 'nn.functional.log_softmax', IdentityShape, 'float', { dim?: number } >)'nn.functional.dropout'(UnaryOpSchema< 'nn.functional.dropout', IdentityShape, 'same', { p?: number; training?: boolean } >)'nn.functional.linear'(BinaryOpSchema<'nn.functional.linear', 'matmul', 'same'>)
Central registry of all operation schemas.
This interface defines the type signature for every operation in torch.js. Users can extend this interface via TypeScript declaration merging to register custom operations:
Examples
declare module '@torchjsorg/torch.js' {
interface OpSchemas {
my_custom_op: UnaryOpSchema<'my_custom_op', IdentityShape, 'same'>;
}
}