Skip to content

Commit 2007a65

Browse files
committed
format files with scalafmt
1 parent 98e76e0 commit 2007a65

22 files changed

+220
-129
lines changed

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

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,31 @@ import js.|
2222

2323
@js.native
2424
trait Features extends js.Object {
25-
var DEBUG: Boolean = js.native
26-
var IS_BROWSER: Boolean = js.native
27-
var IS_NODE: Boolean = js.native
28-
var WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION: Double = js.native
25+
var DEBUG: Boolean = js.native
26+
var IS_BROWSER: Boolean = js.native
27+
var IS_NODE: Boolean = js.native
28+
var WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION: Double = js.native
2929
var WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE: Boolean = js.native
30-
var WEBGL_VERSION: Double = js.native
31-
var HAS_WEBGL: Boolean = js.native
32-
var WEBGL_RENDER_FLOAT32_ENABLED: Boolean = js.native
33-
var WEBGL_DOWNLOAD_FLOAT_ENABLED: Boolean = js.native
34-
var WEBGL_FENCE_API_ENABLED: Boolean = js.native
35-
var BACKEND: String = js.native
36-
var TEST_EPSILON: Double = js.native
37-
var IS_CHROME: Boolean = js.native
38-
var IS_TEST: Boolean = js.native
30+
var WEBGL_VERSION: Double = js.native
31+
var HAS_WEBGL: Boolean = js.native
32+
var WEBGL_RENDER_FLOAT32_ENABLED: Boolean = js.native
33+
var WEBGL_DOWNLOAD_FLOAT_ENABLED: Boolean = js.native
34+
var WEBGL_FENCE_API_ENABLED: Boolean = js.native
35+
var BACKEND: String = js.native
36+
var TEST_EPSILON: Double = js.native
37+
var IS_CHROME: Boolean = js.native
38+
var IS_TEST: Boolean = js.native
3939
}
4040

4141
@js.native
42-
sealed trait Type extends js.Object {
43-
}
42+
sealed trait Type extends js.Object {}
4443

4544
@js.native
4645
@JSGlobal
4746
object Type extends js.Object {
48-
var NUMBER: Type = js.native
47+
var NUMBER: Type = js.native
4948
var BOOLEAN: Type = js.native
50-
var STRING: Type = js.native
49+
var STRING: Type = js.native
5150
@JSBracketAccess
5251
def apply(value: Type): String = js.native
5352
}
@@ -61,13 +60,14 @@ trait URLProperty extends js.Object {
6160
@js.native
6261
@JSGlobalScope
6362
object Environment_util extends js.Object {
64-
val URL_PROPERTIES: js.Array[URLProperty] = js.native
63+
val URL_PROPERTIES: js.Array[URLProperty] = js.native
6564
def isWebGLVersionEnabled(webGLVersion: Int, isBrowser: Boolean): Boolean = js.native
66-
def getWebGLDisjointQueryTimerVersion(webGLVersion: Double, isBrowser: Boolean): Double = js.native
65+
def getWebGLDisjointQueryTimerVersion(webGLVersion: Double, isBrowser: Boolean): Double =
66+
js.native
6767
def isRenderToFloatTextureEnabled(webGLVersion: Double, isBrowser: Boolean): Boolean = js.native
6868
def isDownloadFloatTextureEnabled(webGLVersion: Double, isBrowser: Boolean): Boolean = js.native
69-
def isWebGLFenceEnabled(webGLVersion: Double, isBrowser: Boolean): Boolean = js.native
70-
def isChrome(): Boolean = js.native
71-
def getFeaturesFromURL(): Features = js.native
72-
def getQueryParams(queryString: String): js.Dictionary[String] = js.native
73-
}
69+
def isWebGLFenceEnabled(webGLVersion: Double, isBrowser: Boolean): Boolean = js.native
70+
def isChrome(): Boolean = js.native
71+
def getFeaturesFromURL(): Features = js.native
72+
def getQueryParams(queryString: String): js.Dictionary[String] = js.native
73+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ trait Index
4545
type DataType = core.DataType
4646
type InferenceModel = core.InferenceModel
4747
type ModelPredictConfig = core.ModelPredictConfig
48-
type NamedTensorMap = core.NamedTensorMap
48+
type NamedTensorMap = core.NamedTensorMap
4949
type Rank = core.Rank
5050
// TODO LSTMCellFunc
5151
// TODO Reduction

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@ package io.brunk.tfjs.core.io
1919
import scala.scalajs.js
2020
import js.annotation._
2121
import scala.scalajs.js.typedarray.ArrayBuffer
22-
import _root_.io.brunk.tfjs.core.io.types.{IOHandler, ModelArtifacts, SaveResult, WeightsManifestEntry}
22+
import _root_.io.brunk.tfjs.core.io.types.{
23+
IOHandler,
24+
ModelArtifacts,
25+
SaveResult,
26+
WeightsManifestEntry
27+
}
2328

2429
@js.native
2530
@JSGlobalScope
2631
object Passthrough extends js.Object {
27-
def fromMemory(modelTopology: js.Any, weightSpecs: js.Array[WeightsManifestEntry] = ???, weightData: ArrayBuffer = ???): IOHandler = js.native
32+
def fromMemory(
33+
modelTopology: js.Any,
34+
weightSpecs: js.Array[WeightsManifestEntry] = ???,
35+
weightData: ArrayBuffer = ???
36+
): IOHandler = js.native
2837
def withSaveHandler(saveHandler: js.Function1[ModelArtifacts, SaveResult]): IOHandler = js.native
29-
}
38+
}

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package io.brunk.tfjs.core.io
1818

1919
import scala.scalajs.js
2020
import js.annotation._
21-
import js.{Promise, |}
21+
import js.{ Promise, | }
2222
import scala.scalajs.js.typedarray.ArrayBuffer
2323
import _root_.io.brunk.tfjs.core.io.types.WeightsManifestConfig
2424
import _root_.io.brunk.tfjs.core.NamedTensorMap
@@ -27,7 +27,14 @@ import org.scalajs.dom.experimental.RequestInit
2727
@js.native
2828
@JSGlobalScope
2929
object Weights_loader extends js.Object {
30-
def loadWeightsAsArrayBuffer(fetchURLs: js.Array[String], requestOptions: RequestInit = ???): Promise[js.Array[ArrayBuffer]] = js.native
31-
def loadWeights(manifest: WeightsManifestConfig, filePathPrefix: String = ???, weightNames: js.Array[String] = ???, requestOptions: RequestInit = ???): Promise[NamedTensorMap] = js.native
30+
def loadWeightsAsArrayBuffer(
31+
fetchURLs: js.Array[String],
32+
requestOptions: RequestInit = ???
33+
): Promise[js.Array[ArrayBuffer]] = js.native
34+
def loadWeights(
35+
manifest: WeightsManifestConfig,
36+
filePathPrefix: String = ???,
37+
weightNames: js.Array[String] = ???,
38+
requestOptions: RequestInit = ???
39+
): Promise[NamedTensorMap] = js.native
3240
}
33-

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ package io.brunk.tfjs.core.kernels
1919
import io.brunk.tfjs.core._
2020
import _root_.io.brunk.tfjs.core.TensorModule._
2121
import _root_.io.brunk.tfjs.core.Types.TypedArray
22-
import _root_.io.brunk.tfjs.core.kernels.webgl.{GPGPUContext, TextureData, TextureManager}
22+
import _root_.io.brunk.tfjs.core.kernels.webgl.{ GPGPUContext, TextureData, TextureManager }
2323
import _root_.io.brunk.tfjs.core.ops.Conv_util.Conv2DInfo
2424
import org.scalajs.dom
2525
import org.scalajs.dom.html
2626
import org.scalajs.dom.webgl.Texture
2727

2828
import scala.scalajs.js
2929
import js.annotation._
30-
import js.{Promise, |}
30+
import js.{ Promise, | }
3131
import Engine.MemoryInfo
3232

3333
@js.native
@@ -36,17 +36,17 @@ trait CPUTimerQuery extends js.Object {
3636
var endMs: Double = js.native
3737
}
3838

39-
@js.native
40-
trait WebGLMemoryInfo extends MemoryInfo {
41-
var numBytesInGPU: Double = js.native
42-
var unreliable: Boolean = js.native
43-
}
39+
@js.native
40+
trait WebGLMemoryInfo extends MemoryInfo {
41+
var numBytesInGPU: Double = js.native
42+
var unreliable: Boolean = js.native
43+
}
4444

45-
@js.native
46-
trait WebGLTimingInfo extends TimingInfo {
47-
var uploadWaitMs: Double = js.native
48-
var downloadWaitMs: Double = js.native
49-
}
45+
@js.native
46+
trait WebGLTimingInfo extends TimingInfo {
47+
var uploadWaitMs: Double = js.native
48+
var downloadWaitMs: Double = js.native
49+
}
5050

5151
@js.native
5252
@JSGlobal

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ import js.annotation._
2525
@js.native
2626
@JSGlobalScope
2727
object Non_max_suppression_impl extends js.Object {
28-
def nonMaxSuppressionImpl(boxes: TypedArray, scores: TypedArray, maxOutputSize: Double, iouThreshold: Double, scoreThreshold: Double): Tensor1D = js.native
28+
def nonMaxSuppressionImpl(
29+
boxes: TypedArray,
30+
scores: TypedArray,
31+
maxOutputSize: Double,
32+
iouThreshold: Double,
33+
scoreThreshold: Double
34+
): Tensor1D = js.native
2935
}
30-

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ import js.annotation._
2222
import io.brunk.tfjs.core.DataType
2323
import io.brunk.tfjs.core.Types.TypedArray
2424
import io.brunk.tfjs.core.TensorModule.TensorND
25-
26-
2725
@js.native
2826
@JSGlobalScope
2927
object Topk_impl extends js.Object {
30-
def topkImpl[T <: TensorND](x: TypedArray, xShape: js.Array[Double], xDtype: DataType, k: Double, sorted: Boolean): js.Tuple2[T, T] = js.native
28+
def topkImpl[T <: TensorND](
29+
x: TypedArray,
30+
xShape: js.Array[Double],
31+
xDtype: DataType,
32+
k: Double,
33+
sorted: Boolean
34+
): js.Tuple2[T, T] = js.native
3135
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class GPGPUContext protected () extends js.Object {
3131
var gl: webgl.RenderingContext = js.native
3232
var loseContextExtension: WebGLLoseContextExtension = js.native
3333
var disjointQueryTimerExtension
34-
: WebGL2DisjointQueryTimerExtension | WebGL1DisjointQueryTimerExtension = js.native
35-
var vertexBuffer: webgl.Buffer = js.native
36-
var indexBuffer: webgl.Buffer = js.native
37-
var framebuffer: webgl.Framebuffer = js.native
38-
var outputTexture: webgl.Texture | Null = js.native
39-
var program: webgl.Program | Null = js.native
40-
def dispose(): Unit = js.native
41-
def enableAutomaticDebugValidation(enabled: Boolean): Unit = js.native
34+
: WebGL2DisjointQueryTimerExtension | WebGL1DisjointQueryTimerExtension = js.native
35+
var vertexBuffer: webgl.Buffer = js.native
36+
var indexBuffer: webgl.Buffer = js.native
37+
var framebuffer: webgl.Framebuffer = js.native
38+
var outputTexture: webgl.Texture | Null = js.native
39+
var program: webgl.Program | Null = js.native
40+
def dispose(): Unit = js.native
41+
def enableAutomaticDebugValidation(enabled: Boolean): Unit = js.native
4242
def createFloat32MatrixTexture(rows: Double, columns: Double): webgl.Texture = js.native
4343
def createFloat16MatrixTexture(rows: Double, columns: Double): webgl.Texture = js.native
4444
def createUnsignedBytesMatrixTexture(rows: Double, columns: Double): webgl.Texture = js.native

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@ import js.|
2323
@js.native
2424
@JSGlobal
2525
class LRNGradProgram protected () extends GPGPUProgram {
26-
def this(inputShape: js.Array[Double], depthRadius: Double, bias: Double, alpha: Double, beta: Double) = this()
26+
def this(
27+
inputShape: js.Array[Double],
28+
depthRadius: Double,
29+
bias: Double,
30+
alpha: Double,
31+
beta: Double
32+
) = this()
2733
var variableNames: js.Array[String] = js.native
28-
var outputShape: js.Array[Double] = js.native
29-
var userCode: String = js.native
30-
var depthRadius: Double = js.native
31-
var bias: Double = js.native
32-
var alpha: Double = js.native
33-
var beta: Double = js.native
34-
var depth: Double = js.native
34+
var outputShape: js.Array[Double] = js.native
35+
var userCode: String = js.native
36+
var depthRadius: Double = js.native
37+
var bias: Double = js.native
38+
var alpha: Double = js.native
39+
var beta: Double = js.native
40+
var depth: Double = js.native
3541
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ import io.brunk.tfjs.core.TensorModule.Tensor4D
2424
class ResizeNearestNeigborBackpropProgram protected () extends GPGPUProgram {
2525
def this(dy: Tensor4D, x: Tensor4D, alignCorners: Boolean) = this()
2626
var variableNames: js.Array[String] = js.native
27-
var outputShape: js.Array[Double] = js.native
28-
var userCode: String = js.native
29-
}
27+
var outputShape: js.Array[Double] = js.native
28+
var userCode: String = js.native
29+
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ import js.|
2525
class SelectProgram protected () extends GPGPUProgram {
2626
def this(cRank: Double, shape: js.Array[Double], rank: Double) = this()
2727
var variableNames: js.Array[String] = js.native
28-
var outputShape: js.Array[Double] = js.native
29-
var userCode: String = js.native
30-
}
28+
var outputShape: js.Array[Double] = js.native
29+
var userCode: String = js.native
30+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ import js.|
2424
@JSGlobalScope
2525
object Log extends js.Object {
2626
def warn(msg: js.Any*): Unit = js.native
27-
def log(msg: js.Any*): Unit = js.native
27+
def log(msg: js.Any*): Unit = js.native
2828
}

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,22 @@ import scala.scalajs.js
2020
import js.annotation._
2121
import js.|
2222
import _root_.io.brunk.tfjs.core.TensorModule.TensorND
23-
24-
2523
@js.native
2624
trait ModelPredictConfig extends js.Object {
2725
var batchSize: Double = js.native
28-
var verbose: Boolean = js.native
26+
var verbose: Boolean = js.native
2927
}
3028

3129
@js.native
3230
trait InferenceModel extends js.Object {
33-
def inputs: js.Array[TensorInfo] = js.native
31+
def inputs: js.Array[TensorInfo] = js.native
3432
def outputs: js.Array[TensorInfo] = js.native
35-
def predict(inputs: TensorND | js.Array[TensorND] | NamedTensorMap, config: ModelPredictConfig): TensorND | js.Array[TensorND] | NamedTensorMap = js.native
36-
def execute(inputs: TensorND | js.Array[TensorND] | NamedTensorMap, outputs: String | js.Array[String]): TensorND | js.Array[TensorND] = js.native
33+
def predict(
34+
inputs: TensorND | js.Array[TensorND] | NamedTensorMap,
35+
config: ModelPredictConfig
36+
): TensorND | js.Array[TensorND] | NamedTensorMap = js.native
37+
def execute(
38+
inputs: TensorND | js.Array[TensorND] | NamedTensorMap,
39+
outputs: String | js.Array[String]
40+
): TensorND | js.Array[TensorND] = js.native
3741
}
38-

tfjs-core/src/main/scala/io/brunk/tfjs/core/ops/array_ops.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ trait ArrayOps extends js.Object {
6060
values: TensorLike6D,
6161
shape: js.Tuple6[Double, Double, Double, Double, Double, Double] = ???,
6262
dtype: DataType = ???
63-
): Tensor6D = js.native
63+
): Tensor6D = js.native
6464
def ones[R <: Rank](shape: R#Shape, dtype: DataType = ???): Tensor[R] = js.native
6565
def zeros[R <: Rank](shape: R#Shape, dtype: DataType = ???): Tensor[R] = js.native
6666
def fill[R <: Rank](shape: R#Shape, value: Double, dtype: DataType = ???): Tensor[R] = js.native

tfjs-core/src/main/scala/io/brunk/tfjs/core/ops/array_ops_util.scala

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,28 @@ import js.annotation._
2222
@js.native
2323
@JSGlobalScope
2424
object Array_ops_util extends js.Object {
25-
def getReshaped(inputShape: js.Array[Double], blockShape: js.Array[Double], prod: Double, batchToSpace: Boolean = ???): js.Array[Double] = js.native
26-
def getPermuted(reshapedRank: Double, blockShapeRank: Double, batchToSpace: Boolean = ???): js.Array[Double] = js.native
27-
def getReshapedPermuted(inputShape: js.Array[Double], blockShape: js.Array[Double], prod: Double, batchToSpace: Boolean = ???): js.Array[Double] = js.native
28-
def getSliceBeginCoords(crops: js.Array[js.Array[Double]], blockShape: Double): js.Array[Double] = js.native
29-
def getSliceSize(uncroppedShape: js.Array[Double], crops: js.Array[js.Array[Double]], blockShape: Double): js.Array[Double] = js.native
25+
def getReshaped(
26+
inputShape: js.Array[Double],
27+
blockShape: js.Array[Double],
28+
prod: Double,
29+
batchToSpace: Boolean = ???
30+
): js.Array[Double] = js.native
31+
def getPermuted(
32+
reshapedRank: Double,
33+
blockShapeRank: Double,
34+
batchToSpace: Boolean = ???
35+
): js.Array[Double] = js.native
36+
def getReshapedPermuted(
37+
inputShape: js.Array[Double],
38+
blockShape: js.Array[Double],
39+
prod: Double,
40+
batchToSpace: Boolean = ???
41+
): js.Array[Double] = js.native
42+
def getSliceBeginCoords(crops: js.Array[js.Array[Double]], blockShape: Double): js.Array[Double] =
43+
js.native
44+
def getSliceSize(
45+
uncroppedShape: js.Array[Double],
46+
crops: js.Array[js.Array[Double]],
47+
blockShape: Double
48+
): js.Array[Double] = js.native
3049
}

tfjs-core/src/main/scala/io/brunk/tfjs/core/ops/relu_ops.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ import js.annotation._
2121
import js.|
2222
import io.brunk.tfjs.core.TensorModule.TensorND
2323
import io.brunk.tfjs.core.Types.TensorLike
24-
25-
2624
@js.native
2725
@JSGlobalScope
2826
object Relu_ops extends js.Object {
29-
def relu[T <: TensorND](x: T | TensorLike): T = js.native
30-
def elu[T <: TensorND](x: T | TensorLike): T = js.native
31-
def selu[T <: TensorND](x: T | TensorLike): T = js.native
27+
def relu[T <: TensorND](x: T | TensorLike): T = js.native
28+
def elu[T <: TensorND](x: T | TensorLike): T = js.native
29+
def selu[T <: TensorND](x: T | TensorLike): T = js.native
3230
def leakyRelu[T <: TensorND](x: T | TensorLike, alpha: Double = ???): T = js.native
33-
def prelu[T <: TensorND](x: T | TensorLike, alpha: T | TensorLike): T = js.native
34-
}
31+
def prelu[T <: TensorND](x: T | TensorLike, alpha: T | TensorLike): T = js.native
32+
}

0 commit comments

Comments
 (0)