Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit be5eff0

Browse files
committedDec 7, 2020
Add ones op
Signed-off-by: Ryan Nett <[email protected]>
1 parent 8f9d878 commit be5eff0

File tree

1 file changed

+18
-0
lines changed
  • tensorflow-core-kotlin/tensorflow-core-kotlin-api/src/gen/annotations/org/tensorflow/op/kotlin

1 file changed

+18
-0
lines changed
 

‎tensorflow-core-kotlin/tensorflow-core-kotlin-api/src/gen/annotations/org/tensorflow/op/kotlin/KotlinOps.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ import org.tensorflow.op.core.MutexLock
125125
import org.tensorflow.op.core.NextIteration
126126
import org.tensorflow.op.core.NoOp
127127
import org.tensorflow.op.core.OneHot
128+
import org.tensorflow.op.core.Ones
128129
import org.tensorflow.op.core.OnesLike
129130
import org.tensorflow.op.core.OrderedMapClear
130131
import org.tensorflow.op.core.OrderedMapIncompleteSize
@@ -4284,6 +4285,23 @@ public class KotlinOps(
42844285
).toTypedArray()
42854286
)
42864287

4288+
/**
4289+
* Creates a one valued tensor given its type and shape.
4290+
*
4291+
* @param scope is a scope used to add the underlying operation
4292+
* @param dims a 1-D operand that represents the shape of the output tensor
4293+
* @param type the output tensor datatype. Can not be TString.
4294+
* @return a constant tensor initialized with ones
4295+
* @throws IllegalArgumentException if the tensor type or shape cannot be initialized with
4296+
* ones.
4297+
* @see org.tensorflow.op.Ops.ones
4298+
*/
4299+
public fun <T : TType, U : TNumber> ones(dims: Operand<U>, type: DataType<T>): Ones<T> =
4300+
java.ones<T, U>(
4301+
dims,
4302+
type
4303+
)
4304+
42874305
/**
42884306
* Returns a tensor of ones with the same shape and type as x.
42894307
*

0 commit comments

Comments
 (0)
Please sign in to comment.