@@ -212,18 +212,19 @@ package object onnx {
212
212
(callOp(name, " BatchNormalization" , allInputs, map))
213
213
}
214
214
}
215
+ /* - Not supported - cast on the JVM side
215
216
//Missing in NDScala P2 - needs match type from data type to int
216
217
trait CastV13 extends Operator {
217
218
def CastV9[
218
219
@sp T1 <: BFloat16 | Float16 | Float | Double | Byte | Short | Int | Long | UByte | UShort | UInt | ULong | Boolean | String: Numeric,
219
220
@sp T2 <: BFloat16 | Float16 | Float | Double | Byte | Short | Int | Long | UByte | UShort | UInt | ULong | Boolean | String: Numeric
220
- , Tt <: TensorTypeDenotation , Td <: TensorShapeDenotation , S <: Shape ](name : String , to : ( Int ), input : Tensor [T1 ,Tuple3 [Tt , Td , S ]])(using tt : ValueOf [Tt ], td : TensorShapeDenotationOf [Td ], s : ShapeOf [S ]): Tensor [T2 , Tuple3 [Tt , Td , S ]] = {
221
+ , Tt <: TensorTypeDenotation, Td <: TensorShapeDenotation, S <: Shape](name: String, input: Tensor[T1,Tuple3[Tt, Td, S]])(using tt: ValueOf[Tt], td: TensorShapeDenotationOf[Td], s: ShapeOf[S]): Tensor[T2, Tuple3[Tt, Td, S]] = {
221
222
val map: Map[String, Any] = Map("to" -> to)
222
223
val allInputs = Tuple1(input)
223
224
(callOp(name, "Cast", allInputs, map))
224
225
}
225
226
}
226
-
227
+ */
227
228
trait CeilV13 extends Operator {
228
229
def CeilV13 [@ sp T <: BFloat16 | Float16 | Float | Double : Numeric , Tt <: TensorTypeDenotation , Td <: TensorShapeDenotation , S <: Shape ](
229
230
name : String ,
@@ -387,16 +388,16 @@ package object onnx {
387
388
}
388
389
}
389
390
390
- // Missing in NDScala - P2 - needs expand match type
391
+ // Missing in NDScala - P2 - needs expand match type - WIP
391
392
// Explicit broadcasting
392
393
trait ExpandV13 extends Operator {
393
394
def ExpandV13 [
394
395
@ sp T <: UByte | UShort | UInt | ULong | Byte | Short | Int | Long | BFloat16 | Float16 | Float | Double | String | Boolean | Complex [
395
396
Float
396
397
] | Complex [Double ]: Numeric
397
- , Tt <: TensorTypeDenotation , Td <: TensorShapeDenotation , S <: Shape , Tt1 <: TensorTypeDenotation , Td1 <: TensorShapeDenotation , S1 <: Shape , Tt2 <: TensorTypeDenotation , Td2 <: TensorShapeDenotation , S2 <: Shape ](name : String , input : Tensor [T , Tuple3 [Tt ,Td ,S ]], shapeInput : Tensor [ Long , Tuple3 [ Tt1 , Td1 , S1 ]] )(using tt : ValueOf [Tt2 ], td : TensorShapeDenotationOf [Td2 ], s : ShapeOf [S2 ]): Tensor [T , Tuple3 [Tt2 ,Td2 ,S2 ]] = {
398
+ , Tt <: TensorTypeDenotation , Td <: TensorShapeDenotation , S <: Shape , Tt1 <: TensorTypeDenotation , Td1 <: TensorShapeDenotation , S1 <: Shape , Tt2 <: TensorTypeDenotation , Td2 <: TensorShapeDenotation , S2 <: Shape ](name : String , input : Tensor [T , Tuple3 [Tt ,Td ,S ]], shapeInput : S2 )(using tt : ValueOf [Tt2 ], td : TensorShapeDenotationOf [Td2 ], s : ShapeOf [S2 ]): Tensor [T , Tuple3 [Tt2 ,Td2 ,S2 ]] = {
398
399
val map : Map [String , Any ] = Map ()
399
- val allInputs = Tuple2 (input, shapeInput)
400
+ val allInputs = Tuple2 (input, shapeInput.toSeq.toArray )
400
401
(callOp(name, " Expand" , allInputs, map))
401
402
}
402
403
}
@@ -1146,14 +1147,14 @@ package object onnx {
1146
1147
(callOp(name, " Transpose" , allInputs, map))
1147
1148
}
1148
1149
}
1149
- // Missing in NDScala - P2 - Needs expand match type for output
1150
+ // Missing in NDScala - P2 - Needs expand match type for output - WIP
1150
1151
// Missing in ONNX.js
1151
1152
trait UnsqueezeV13 extends Operator {
1152
1153
def UnsqueezeV13 [
1153
1154
@ sp T <: UByte | UShort | UInt | ULong | Byte | Short | Int | Long | BFloat16 | Float16 | Float | Double | String | Boolean | Complex [
1154
1155
Float
1155
1156
] | Complex [Double ]: Numeric
1156
- , Tt <: TensorTypeDenotation , Td <: TensorShapeDenotation , S <: Shape , Tt1 <: TensorTypeDenotation , Axes <: Indices ](name : String , axes : Axes , data : Tensor [T , Tuple3 [Tt ,Td ,S ]])(using tt : ValueOf [Tt1 ], td : TensorShapeDenotationOf [KeepOrReduceDimDenotations [ Td , Axes , false ]] , s : ShapeOf [KeepOrReduceDims [S ,Axes , false ]], i : IndicesOf [Axes ]): Tensor [T , Tuple3 [Tt1 ,KeepOrReduceDimDenotations [ Td ,Axes , false ], KeepOrReduceDims [S ,Axes , false ]]] = {
1157
+ , Tt <: TensorTypeDenotation , Td <: TensorShapeDenotation , S <: Shape , Tt1 <: TensorTypeDenotation , Axes <: Indices ](name : String , axes : Axes , data : Tensor [T , Tuple3 [Tt ,Td ,S ]])(using tt : ValueOf [Tt1 ], td : TensorShapeDenotationOf [Td ] , s : ShapeOf [UnsqueezeShape [S ,Axes ]], i : IndicesOf [Axes ]): Tensor [T , Tuple3 [Tt1 ,Td ,UnsqueezeShape [S ,Axes ]]] = {
1157
1158
val axes = indicesOf[Axes ].indices.toArray
1158
1159
val map : Map [String , Any ] = Map ()
1159
1160
val allInputs = Tuple2 (data, Tensor (axes.map(_.toLong), Shape .fromSeq(ArraySeq .unsafeWrapArray(Array (axes.size)))))
0 commit comments