(* types.sml * * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu) * All rights reserved. *) structure Types : TYPES = sig (* kinds for type variables *) datatype kind = TK_DIM (* ranges over dimensions (1, 2, ...) *) | TK_INT (* ranges over integer types *) | TK_FLT (* ranges over floating-point types *) | TK_RAW (* ranges over raw (scalar) types *) datatype raw_ty = Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Float | Double datatype ty = T_Var of var | T_Bool (* scalars, vectors, matrices, etc. *) | T_Tensor of {order : dim list, ty : raw_ty} (* data sets from NNRD *) | T_Data of { dim : dim, (* 2D or 3D data set *) order : dim list, (* tensor order/dimension info *) rep_ty : ty (* representation type of elements (raw kind) *) } (* continuous field reconstructed from a data set *) | T_Field of { dim : dim, (* 2D or 3D field *) order : dim list, (* tensor order/dimension info *) rep_ty : ty, (* representation type of elements (raw kind) *) ty : ty (* type of samples (float kind) *) } and dim = DIM of word | DIMVAR of var (* type variables *) and var = TV of { stamp : Stamp.stamp, kind : kind } (* given a dataset or field type, return the element type, which will be * a tensor type. *) fun elemTypeOf (T_Data{order, rep_ty, ...}) = T_Tensor{order=order, ty=rep_ty} | elemTypeOf (T_Field{order, ty, ...}) = T_Tensor{order=order, ty=ty} | elemTypeOf _ = raise Fail "not a dataset/field" end
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: ...}) = T_Tensor{order=order, ty=ty} | elemTypeOf _ = raise Fail "not a dataset/field" end