tf.squared_difference()

tf.squared_difference(x, y, name=None) Returns (x - y)(x - y) element-wise. NOTE: SquaredDifference supports broadcasting. More about broadcasting here Args: x: A Tensor. Must be one of the following types: half, float32, float64, int32, int64, complex64, complex128. y: A Tensor. Must have the same type as x. name: A name for the operation (optional). Returns: A Tensor. Has the same type as x.

tf.square()

tf.square(x, name=None) Computes square of x element-wise. I.e., (y = x * x = x^2). Args: x: A Tensor or SparseTensor. Must be one of the following types: half, float32, float64, int32, int64, complex64, complex128. name: A name for the operation (optional). Returns: A Tensor or SparseTensor. Has the same type as x.

tf.sqrt()

tf.sqrt(x, name=None) Computes square root of x element-wise. I.e., (y = \sqrt{x} = x^{1/2}). Args: x: A Tensor or SparseTensor. Must be one of the following types: half, float32, float64, complex64, complex128. name: A name for the operation (optional). Returns: A Tensor or SparseTensor, respectively. Has the same type as x.

tf.sparse_transpose()

tf.sparse_transpose(sp_input, perm=None, name=None) Transposes a SparseTensor The returned tensor's dimension i will correspond to the input dimension perm[i]. If perm is not given, it is set to (n-1...0), where n is the rank of the input tensor. Hence by default, this operation performs a regular matrix transpose on 2-D input Tensors. For example, if sp_input has shape [4, 5] and indices / values: [0, 3]: b [0, 1]: a [3, 1]: d [2, 0]: c then the output will be a SparseTensor of shape [5, 4]

tf.sparse_to_indicator()

tf.sparse_to_indicator(sp_input, vocab_size, name=None) Converts a SparseTensor of ids into a dense bool indicator tensor. The last dimension of sp_input.indices is discarded and replaced with the values of sp_input. If sp_input.shape = [D0, D1, ..., Dn, K], then output.shape = [D0, D1, ..., Dn, vocab_size], where output[d_0, d_1, ..., d_n, sp_input[d_0, d_1, ..., d_n, k]] = True and False elsewhere in output. For example, if sp_input.shape = [2, 3, 4] with non-empty values: [0, 0, 0]: 0 [0,

tf.sparse_to_dense()

tf.sparse_to_dense(sparse_indices, output_shape, sparse_values, default_value=0, validate_indices=True, name=None) Converts a sparse representation into a dense tensor. Builds an array dense with shape output_shape such that # If sparse_indices is scalar dense[i] = (i == sparse_indices ? sparse_values : default_value) # If sparse_indices is a vector, then for each i dense[sparse_indices[i]] = sparse_values[i] # If sparse_indices is an n by d matrix, then for each i in [0, n) dense[sparse_ind

tf.sparse_tensor_to_dense()

tf.sparse_tensor_to_dense(sp_input, default_value=0, validate_indices=True, name=None) Converts a SparseTensor into a dense tensor. This op is a convenience wrapper around sparse_to_dense for SparseTensors. For example, if sp_input has shape [3, 5] and non-empty string values: [0, 1]: a [0, 3]: b [2, 0]: c and default_value is x, then the output will be a dense [3, 5] string tensor with values: [[x a x b x] [x x x x x] [c x x x x]] Indices must be without repeats. This is only tested if va

tf.sparse_tensor_dense_matmul()

tf.sparse_tensor_dense_matmul(sp_a, b, adjoint_a=False, adjoint_b=False, name=None) Multiply SparseTensor (of rank 2) "A" by dense matrix "B". No validity checking is performed on the indices of A. However, the following input format is recommended for optimal behavior: if adjoint_a == false: A should be sorted in lexicographically increasing order. Use sparse_reorder if you're not sure. if adjoint_a == true: A should be sorted in order of increasing dimension 1 (i.e., "column major" order ins

tf.sparse_split()

tf.sparse_split(split_dim, num_split, sp_input, name=None) Split a SparseTensor into num_split tensors along split_dim. If the sp_input.shape[split_dim] is not an integer multiple of num_split each slice starting from 0:shape[split_dim] % num_split gets extra one dimension. For example, if split_dim = 1 and num_split = 2 and the input is: input_tensor = shape = [2, 7] [ a d e ] [b c ] Graphically the output tensors are: output_tensor[0] = [ a ] [b c ] output_tensor[1] = [

tf.sparse_softmax()

tf.sparse_softmax(sp_input, name=None) Applies softmax to a batched N-D SparseTensor. The inputs represent an N-D SparseTensor with logical shape [..., B, C] (where N >= 2), and with indices sorted in the canonical lexicographic order. This op is equivalent to applying the normal tf.nn.softmax() to each innermost logical submatrix with shape [B, C], but with the catch that the implicitly zero elements do not participate. Specifically, the algorithm is equivalent to: (1) Applies tf.nn.softma