Skip to content

Commit 98e76e0

Browse files
committed
Fix errors in 0.12.8 additions
1 parent b7ea729 commit 98e76e0

18 files changed

+342
-98
lines changed

tfjs-core/src/main/scala/io/brunk/tfjs/core/environment_util.scala

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core
218

319
import scala.scalajs.js
420
import js.annotation._
521
import js.|
622

7-
package environment_util {
8-
923
@js.native
1024
trait Features extends js.Object {
1125
var DEBUG: Boolean = js.native
@@ -56,6 +70,4 @@ object Environment_util extends js.Object {
5670
def isChrome(): Boolean = js.native
5771
def getFeaturesFromURL(): Features = js.native
5872
def getQueryParams(queryString: String): js.Dictionary[String] = js.native
59-
}
60-
61-
}
73+
}
Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core.io
218

319
import scala.scalajs.js
420
import js.annotation._
5-
import js.|
6-
7-
package passthrough {
21+
import scala.scalajs.js.typedarray.ArrayBuffer
22+
import _root_.io.brunk.tfjs.core.io.types.{IOHandler, ModelArtifacts, SaveResult, WeightsManifestEntry}
823

924
@js.native
1025
@JSGlobalScope
1126
object Passthrough extends js.Object {
1227
def fromMemory(modelTopology: js.Any, weightSpecs: js.Array[WeightsManifestEntry] = ???, weightData: ArrayBuffer = ???): IOHandler = js.native
1328
def withSaveHandler(saveHandler: js.Function1[ModelArtifacts, SaveResult]): IOHandler = js.native
14-
}
15-
16-
}
29+
}

tfjs-core/src/main/scala/io/brunk/tfjs/core/io/weights_loader.scala

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core.io
218

319
import scala.scalajs.js
420
import js.annotation._
5-
import js.|
6-
7-
package weights_loader {
21+
import js.{Promise, |}
22+
import scala.scalajs.js.typedarray.ArrayBuffer
23+
import _root_.io.brunk.tfjs.core.io.types.WeightsManifestConfig
24+
import _root_.io.brunk.tfjs.core.NamedTensorMap
25+
import org.scalajs.dom.experimental.RequestInit
826

927
@js.native
1028
@JSGlobalScope
@@ -13,4 +31,3 @@ object Weights_loader extends js.Object {
1331
def loadWeights(manifest: WeightsManifestConfig, filePathPrefix: String = ???, weightNames: js.Array[String] = ???, requestOptions: RequestInit = ???): Promise[NamedTensorMap] = js.native
1432
}
1533

16-
}

tfjs-core/src/main/scala/io/brunk/tfjs/core/kernels/non_max_suppression_impl.scala

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core.kernels
218

19+
import io.brunk.tfjs.core.Types.TypedArray
20+
import io.brunk.tfjs.core.TensorModule.Tensor1D
21+
322
import scala.scalajs.js
423
import js.annotation._
5-
import js.|
6-
7-
package non_max_suppression_impl {
824

925
@js.native
1026
@JSGlobalScope
1127
object Non_max_suppression_impl extends js.Object {
1228
def nonMaxSuppressionImpl(boxes: TypedArray, scores: TypedArray, maxOutputSize: Double, iouThreshold: Double, scoreThreshold: Double): Tensor1D = js.native
1329
}
1430

15-
}
Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core.kernels
218

319
import scala.scalajs.js
420
import js.annotation._
5-
import js.|
621

7-
package topk_impl {
22+
import io.brunk.tfjs.core.DataType
23+
import io.brunk.tfjs.core.Types.TypedArray
24+
import io.brunk.tfjs.core.TensorModule.TensorND
25+
826

927
@js.native
1028
@JSGlobalScope
1129
object Topk_impl extends js.Object {
12-
def topkImpl[T <: Tensor](x: TypedArray, xShape: js.Array[Double], xDtype: DataType, k: Double, sorted: Boolean): js.Tuple2[T, T] = js.native
13-
}
14-
30+
def topkImpl[T <: TensorND](x: TypedArray, xShape: js.Array[Double], xDtype: DataType, k: Double, sorted: Boolean): js.Tuple2[T, T] = js.native
1531
}

tfjs-core/src/main/scala/io/brunk/tfjs/core/kernels/webgl/lrn_grad_gpu.scala

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core.kernels.webgl
218

319
import scala.scalajs.js
420
import js.annotation._
521
import js.|
622

7-
package lrn_grad_gpu {
8-
923
@js.native
1024
@JSGlobal
1125
class LRNGradProgram protected () extends GPGPUProgram {
@@ -19,5 +33,3 @@ class LRNGradProgram protected () extends GPGPUProgram {
1933
var beta: Double = js.native
2034
var depth: Double = js.native
2135
}
22-
23-
}
Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core.kernels.webgl
218

319
import scala.scalajs.js
420
import js.annotation._
5-
import js.|
6-
7-
package resize_nearest_neighbor_backprop_gpu {
8-
21+
import io.brunk.tfjs.core.TensorModule.Tensor4D
922
@js.native
1023
@JSGlobal
1124
class ResizeNearestNeigborBackpropProgram protected () extends GPGPUProgram {
1225
def this(dy: Tensor4D, x: Tensor4D, alignCorners: Boolean) = this()
1326
var variableNames: js.Array[String] = js.native
1427
var outputShape: js.Array[Double] = js.native
1528
var userCode: String = js.native
16-
}
17-
18-
}
29+
}
Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core.kernels.webgl
218

319
import scala.scalajs.js
420
import js.annotation._
521
import js.|
622

7-
package select_gpu {
8-
923
@js.native
1024
@JSGlobal
1125
class SelectProgram protected () extends GPGPUProgram {
1226
def this(cRank: Double, shape: js.Array[Double], rank: Double) = this()
1327
var variableNames: js.Array[String] = js.native
1428
var outputShape: js.Array[Double] = js.native
1529
var userCode: String = js.native
16-
}
17-
18-
}
30+
}

tfjs-core/src/main/scala/io/brunk/tfjs/core/kernels/where_impl.scala

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core.kernels
218

319
import scala.scalajs.js
420
import js.annotation._
521
import js.|
622

7-
package where_impl {
23+
import io.brunk.tfjs.core.TensorModule.Tensor2D
24+
import io.brunk.tfjs.core.Types.TypedArray
825

926
@js.native
1027
@JSGlobalScope
1128
object Where_impl extends js.Object {
1229
def whereImpl(condShape: js.Array[Double], condVals: TypedArray): Tensor2D = js.native
1330
}
14-
15-
}

tfjs-core/src/main/scala/io/brunk/tfjs/core/log.scala

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1+
/*
2+
* Copyright 2017 Sören Brunk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.brunk.tfjs.core
218

319
import scala.scalajs.js
420
import js.annotation._
521
import js.|
622

7-
package log {
8-
923
@js.native
1024
@JSGlobalScope
1125
object Log extends js.Object {
1226
def warn(msg: js.Any*): Unit = js.native
1327
def log(msg: js.Any*): Unit = js.native
1428
}
15-
16-
}

0 commit comments

Comments
 (0)