menu
Overview
API Reference
Node API
tfjs-vis API
tfjs-react-native API
tfjs-tflite API
Task API
API Version
4.22.0
4.21.0
4.20.0
4.19.0
4.18.0
4.17.0
4.16.0
4.15.0
4.14.0
4.13.0
4.12.0
4.11.0
4.10.0
4.9.0
4.8.0
4.7.0
4.6.0
4.4.0
4.2.0
4.1.0
4.0.0
3.21.0
3.19.0
3.18.0
3.17.0
3.16.0
3.15.0
3.14.0
3.13.0
3.12.0
3.9.0
3.8.0
3.7.0
3.6.0
3.5.0
3.4.0
3.2.0
3.1.0
3.0.0
2.8.6
2.8.5
2.8.4
2.8.3
2.8.2
2.8.1
2.8.0
2.7.0
2.6.0
2.4.0
2.3.0
2.1.0
2.0.1
2.0.0
1.7.4
1.7.2
1.7.1
1.7.0
1.6.0
1.5.2
1.5.1
1.3.1
1.3.0
1.2.11
1.2.10
1.2.8
1.2.7
1.2.6
1.2.5
1.1.2
1.1.0
1.0.4
1.0.0
0.15.3
0.15.1
0.14.2
0.14.1
0.13.3
0.13.0
0.12.5
0.12.0
0.11.7
0.11.6
0.11.2
0.11.1
0.10.0
0.9.0
0.8.0
0.7.0
0.6.1
Tensors
Creation
tf.tensor
tf.scalar
tf.tensor1d
tf.tensor2d
tf.tensor3d
tf.tensor4d
tf.tensor5d
tf.tensor6d
tf.buffer
tf.clone
tf.complex
tf.diag
tf.eye
tf.fill
tf.imag
tf.linspace
tf.oneHot
tf.ones
tf.onesLike
tf.print
tf.range
tf.real
tf.truncatedNormal
tf.variable
tf.zeros
tf.zerosLike
Classes
tf.Tensor
.buffer
.bufferSync
.array
.arraySync
.data
.dataToGPU
.dataSync
.dispose
.print
.clone
.toString
tf.Variable
.assign
tf.TensorBuffer
.set
.get
.toTensor
Transformations
tf.batchToSpaceND
tf.broadcastArgs
tf.broadcastTo
tf.cast
tf.depthToSpace
tf.ensureShape
tf.expandDims
tf.mirrorPad
tf.pad
tf.reshape
tf.setdiff1dAsync
tf.spaceToBatchND
tf.squeeze
Slicing and Joining
tf.booleanMaskAsync
tf.concat
tf.gather
tf.reverse
tf.slice
tf.split
tf.stack
tf.tile
tf.unstack
Matrices
tf.einsum
Random
tf.multinomial
tf.rand
tf.randomGamma
tf.randomNormal
tf.randomStandardNormal
tf.randomUniform
tf.randomUniformInt
Models
Creation
tf.sequential
tf.model
Inputs
tf.input
Loading
tf.loadGraphModel
tf.loadLayersModel
tf.io.browserDownloads
tf.io.browserFiles
tf.io.http
tf.loadGraphModelSync
Management
tf.io.copyModel
tf.io.listModels
tf.io.moveModel
tf.io.removeModel
Serialization
tf.registerClass
Classes
tf.Functional
tf.GraphModel
.loadSync
.save
.predict
.predictAsync
.execute
.executeAsync
.getIntermediateTensors
.disposeIntermediateTensors
.dispose
tf.LayersModel
.summary
.compile
.evaluate
.evaluateDataset
.predict
.predictOnBatch
.fit
.fitDataset
.trainOnBatch
.save
.getLayer
.getLayer
.getLayer
.getLayer
tf.Sequential
.add
tf.SymbolicTensor
Op Registry
tf.deregisterOp
tf.getRegisteredOp
tf.registerOp
Layers
Advanced Activation
tf.layers.elu
tf.layers.leakyReLU
tf.layers.prelu
tf.layers.reLU
tf.layers.softmax
tf.layers.thresholdedReLU
Basic
tf.layers.activation
tf.layers.dense
tf.layers.dropout
tf.layers.embedding
tf.layers.flatten
tf.layers.permute
tf.layers.repeatVector
tf.layers.reshape
tf.layers.spatialDropout1d
Convolutional
tf.layers.conv1d
tf.layers.conv2d
tf.layers.conv2dTranspose
tf.layers.conv3d
tf.layers.cropping2D
tf.layers.depthwiseConv2d
tf.layers.separableConv2d
tf.layers.upSampling2d
Merge
tf.layers.add
tf.layers.average
tf.layers.concatenate
tf.layers.dot
tf.layers.maximum
tf.layers.minimum
tf.layers.multiply
Normalization
tf.layers.batchNormalization
tf.layers.layerNormalization
Pooling
tf.layers.averagePooling1d
tf.layers.averagePooling2d
tf.layers.averagePooling3d
tf.layers.globalAveragePooling1d
tf.layers.globalAveragePooling2d
tf.layers.globalMaxPooling1d
tf.layers.globalMaxPooling2d
tf.layers.maxPooling1d
tf.layers.maxPooling2d
tf.layers.maxPooling3d
Recurrent
tf.layers.convLstm2d
tf.layers.convLstm2dCell
tf.layers.gru
tf.layers.gruCell
tf.layers.lstm
tf.layers.lstmCell
tf.layers.rnn
tf.layers.simpleRNN
tf.layers.simpleRNNCell
tf.layers.stackedRNNCells
Wrapper
tf.layers.bidirectional
tf.layers.timeDistributed
Classes
tf.layers.Layer
.apply
.countParams
.build
.getWeights
.setWeights
.addWeight
.addLoss
.computeOutputShape
.getConfig
.dispose
tf.RNNCell
Inputs
tf.layers.inputLayer
Padding
tf.layers.zeroPadding2d
Noise
tf.layers.alphaDropout
tf.layers.gaussianDropout
tf.layers.gaussianNoise
Mask
tf.layers.masking
Rescaling
tf.layers.rescaling
CenterCrop
tf.layers.centerCrop
Resizing
tf.layers.resizing
CategoryEncoding
tf.layers.categoryEncoding
RandomWidth
tf.layers.randomWidth
Operations
Arithmetic
tf.add
tf.sub
tf.mul
tf.div
tf.addN
tf.divNoNan
tf.floorDiv
tf.maximum
tf.minimum
tf.mod
tf.pow
tf.squaredDifference
Basic math
tf.abs
tf.acos
tf.acosh
tf.asin
tf.asinh
tf.atan
tf.atan2
tf.atanh
tf.ceil
tf.clipByValue
tf.cos
tf.cosh
tf.elu
tf.erf
tf.exp
tf.expm1
tf.floor
tf.isFinite
tf.isInf
tf.isNaN
tf.leakyRelu
tf.log
tf.log1p
tf.logSigmoid
tf.neg
tf.prelu
tf.reciprocal
tf.relu
tf.relu6
tf.round
tf.rsqrt
tf.selu
tf.sigmoid
tf.sign
tf.sin
tf.sinh
tf.softplus
tf.sqrt
tf.square
tf.step
tf.tan
tf.tanh
Matrices
tf.dot
tf.euclideanNorm
tf.matMul
tf.norm
tf.outerProduct
tf.transpose
Convolution
tf.avgPool
tf.avgPool3d
tf.conv1d
tf.conv2d
tf.conv2dTranspose
tf.conv3d
tf.conv3dTranspose
tf.depthwiseConv2d
tf.dilation2d
tf.maxPool3d
tf.maxPoolWithArgmax
tf.pool
tf.separableConv2d
Reduction
tf.all
tf.any
tf.argMax
tf.argMin
tf.bincount
tf.denseBincount
tf.logSumExp
tf.max
tf.mean
tf.min
tf.prod
tf.sum
Normalization
tf.batchNorm
tf.localResponseNormalization
tf.logSoftmax
tf.moments
tf.softmax
tf.sparseToDense
Images
tf.image.cropAndResize
tf.image.flipLeftRight
tf.image.grayscaleToRGB
tf.image.nonMaxSuppression
tf.image.nonMaxSuppressionAsync
tf.image.nonMaxSuppressionPadded
tf.image.nonMaxSuppressionPaddedAsync
tf.image.nonMaxSuppressionWithScore
tf.image.nonMaxSuppressionWithScoreAsync
tf.image.resizeBilinear
tf.image.resizeNearestNeighbor
tf.image.rgbToGrayscale
tf.image.rotateWithOffset
tf.image.transform
RNN
tf.basicLSTMCell
tf.multiRNNCell
Logical
tf.bitwiseAnd
tf.equal
tf.greater
tf.greaterEqual
tf.less
tf.lessEqual
tf.logicalAnd
tf.logicalNot
tf.logicalOr
tf.logicalXor
tf.notEqual
tf.where
tf.whereAsync
Scan
tf.cumprod
tf.cumsum
Evaluation
tf.confusionMatrix
tf.inTopKAsync
tf.lowerBound
tf.searchSorted
tf.topk
tf.unique
tf.upperBound
Slicing and Joining
tf.gatherND
tf.meshgrid
tf.scatterND
tf.stridedSlice
tf.tensorScatterUpdate
Ragged
tf.raggedTensorToTensor
Spectral
tf.spectral.fft
tf.spectral.ifft
tf.spectral.irfft
tf.spectral.rfft
Segment
tf.unsortedSegmentSum
Moving Average
tf.movingAverage
Dropout
tf.dropout
Signal
tf.signal.frame
tf.signal.hammingWindow
tf.signal.hannWindow
tf.signal.stft
Linear Algebra
tf.linalg.bandPart
tf.linalg.gramSchmidt
tf.linalg.qr
Sparse
tf.sparseFillEmptyRows
tf.sparseReshape
tf.sparseSegmentMean
tf.sparseSegmentSum
String
tf.staticRegexReplace
tf.stringNGrams
tf.stringSplit
tf.stringToHashBucketFast
Training
Gradients
tf.grad
tf.grads
tf.customGrad
tf.valueAndGrad
tf.valueAndGrads
tf.variableGrads
Optimizers
tf.train.sgd
tf.train.momentum
tf.train.adagrad
tf.train.adadelta
tf.train.adam
tf.train.adamax
tf.train.rmsprop
Losses
tf.losses.absoluteDifference
tf.losses.computeWeightedLoss
tf.losses.cosineDistance
tf.losses.hingeLoss
tf.losses.huberLoss
tf.losses.logLoss
tf.losses.meanSquaredError
tf.losses.sigmoidCrossEntropy
tf.losses.softmaxCrossEntropy
Classes
tf.train.Optimizer
.minimize
.computeGradients
.applyGradients
Performance
Memory
tf.tidy
tf.dispose