Module: TensorStream::OpStub
- Included in:
- Ops
- Defined in:
- lib/tensor_stream/generated_stub/ops.rb
Instance Method Summary collapse
-
#add(input_a, input_b, name: nil) ⇒ Object
Returns x + y element-wise.
-
#argmax(input_a, axis = nil, name: nil, dimension: nil, output_type: :int32) ⇒ Object
Returns the index with the largest value across axes of a tensor.
-
#argmin(input_a, axis = nil, name: nil, dimension: nil, output_type: :int32) ⇒ Object
Returns the index with the smallest value across axes of a tensor.
-
#ceil(input_a, name: nil) ⇒ Object
Returns element-wise smallest integer in not less than x.
-
#cos(input_a, name: nil) ⇒ Object
Computes cos of input element-wise.
-
#div(input_a, input_b, name: nil) ⇒ Object
Returns x / y element-wise.
-
#equal(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x == y) element-wise.
-
#expand_dims(input, axis, name: nil) ⇒ Object
Inserts a dimension of 1 into a tensor’s shape.
-
#fill(dims, value, name: nil) ⇒ Object
This operation creates a tensor of shape dims and fills it with value.
-
#floor(input_a, name: nil) ⇒ Object
Returns element-wise largest integer not greater than x.
-
#floor_div(input_a, input_b, name: nil) ⇒ Object
Returns element-wise integer divistion.
-
#greater(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x > y) element-wise.
-
#greater_equal(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x >= y) element-wise.
-
#less(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x < y) element-wise.
-
#less_equal(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x <= y) element-wise.
-
#log(input, name: nil) ⇒ Object
Computes natural logarithm of x element-wise.
-
#mat_mul(input_a, input_b, transpose_a: false, transpose_b: false, name: nil) ⇒ Object
(also: #matmul)
Multiplies matrix a by matrix b, producing a * b.
-
#max(input_a, input_b, name: nil) ⇒ Object
Returns the max of x and y (i.e. x > y ? x : y) element-wise.
-
#min(input_a, input_b, name: nil) ⇒ Object
Returns the min of x and y (i.e. x < y ? x : y) element-wise.
-
#mod(input_a, input_b, name: nil) ⇒ Object
Returns element-wise remainder of division.
-
#mul(input_a, input_b, name: nil) ⇒ Object
Returns x * y element-wise.
-
#negate(input, name: nil) ⇒ Object
Computes numerical negative value element-wise.
-
#not_equal(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x != y) element-wise.
-
#ones_like(input, dtype: nil, name: nil) ⇒ Object
Creates a tensor with all elements set to 1.
-
#pow(input_a, input_b, name: nil) ⇒ Object
Computes the power of one value to another X^Y element wise.
-
#prod(input_a, axis = nil, name: nil, keepdims: false) ⇒ Object
(also: #reduce_prod)
Computes the product of elements across dimensions of a tensor.
-
#random_uniform(shape, name: nil, dtype: :float32, minval: 0, maxval: 1, seed: nil) ⇒ Object
Outputs random values from a uniform distribution.
-
#range(start = 0, limit = 0, delta = 1, name: "range", dtype: nil, output_type: :int32) ⇒ Object
Creates a sequence of numbers.
-
#rank(input, name: nil) ⇒ Object
Returns the rank of a tensor.
-
#reshape(input, shape, name: nil) ⇒ Object
Reshapes a tensor.
-
#round(input_a, name: nil) ⇒ Object
Rounds the values of a tensor to the nearest integer, element-wise.
-
#rsqrt(input_a, name: nil) ⇒ Object
Computes reciprocal of square root of x element-wise.
-
#shape(input, name: nil, out_type: :int32) ⇒ Object
This operation returns a 1-D integer tensor representing the shape of input.
-
#sigmoid(input_a, name: nil) ⇒ Object
Computes sigmoid of x element-wise.
-
#sign(input_a, name: nil) ⇒ Object
Computes sign of input element-wise.
-
#sin(input_a, name: nil) ⇒ Object
Computes sin of input element-wise.
-
#size(input, name: nil, out_type: :int32) ⇒ Object
Returns the size of a tensor.
-
#strided_slice(input, _begin, _end, strides = nil, name: nil) ⇒ Object
Extracts a strided slice of a tensor this op extracts a slice of size ‘(end-begin)/stride` from the given `input_` tensor.
-
#sub(input_a, input_b, name: nil) ⇒ Object
(also: #subtract)
Returns x - y element-wise.
-
#sum(input_a, axis_p = nil, axis: nil, name: nil, keepdims: false) ⇒ Object
(also: #reduce_sum)
Computes the sum of elements across dimensions of a tensor.
-
#tan(input_a, name: nil) ⇒ Object
Computes tan of input element-wise.
-
#tanh(input_a, name: nil) ⇒ Object
Computes tanh of input element-wise.
-
#tile(input, multiples, name: nil) ⇒ Object
Constructs a tensor by tiling a given tensor.
-
#top_k(input, k = 1, sorted: true, name: nil) ⇒ Object
Finds values and indices of the ‘k` largest entries for the last dimension.
-
#zeros(shape, dtype: :float32, name: nil) ⇒ Object
Creates a tensor with all elements set to zero.
Instance Method Details
#add(input_a, input_b, name: nil) ⇒ Object
Returns x + y element-wise.
This operation supports broadcasting
Options:
18 19 20 21 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 18 def add(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:add, input_a, input_b, name: name) end |
#argmax(input_a, axis = nil, name: nil, dimension: nil, output_type: :int32) ⇒ Object
Returns the index with the largest value across axes of a tensor.
Options:
36 37 38 39 40 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 36 def argmax(input_a, axis = nil, name: nil, dimension: nil, output_type: :int32) check_allowed_types(input_a, TensorStream::Ops::NUMERIC_TYPES) check_allowed_types(axis, TensorStream::Ops::INTEGER_TYPES) _op(:argmax, input_a, axis, name: name, dimension: dimension, output_type: output_type) end |
#argmin(input_a, axis = nil, name: nil, dimension: nil, output_type: :int32) ⇒ Object
Returns the index with the smallest value across axes of a tensor.
Options:
55 56 57 58 59 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 55 def argmin(input_a, axis = nil, name: nil, dimension: nil, output_type: :int32) check_allowed_types(input_a, TensorStream::Ops::NUMERIC_TYPES) check_allowed_types(axis, TensorStream::Ops::INTEGER_TYPES) _op(:argmin, input_a, axis, name: name, dimension: dimension, output_type: output_type) end |
#ceil(input_a, name: nil) ⇒ Object
Returns element-wise smallest integer in not less than x
Options:
71 72 73 74 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 71 def ceil(input_a, name: nil) check_allowed_types(input_a, TensorStream::Ops::FLOATING_POINT_TYPES) _op(:ceil, input_a, name: name) end |
#cos(input_a, name: nil) ⇒ Object
Computes cos of input element-wise.
Options:
86 87 88 89 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 86 def cos(input_a, name: nil) check_allowed_types(input_a, TensorStream::Ops::FLOATING_POINT_TYPES) _op(:cos, input_a, name: name) end |
#div(input_a, input_b, name: nil) ⇒ Object
Returns x / y element-wise.
This operation supports broadcasting
Options:
103 104 105 106 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 103 def div(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:div, input_a, input_b, name: name) end |
#equal(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x == y) element-wise.
This operation supports broadcasting
Options:
120 121 122 123 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 120 def equal(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:equal, input_a, input_b, name: name) end |
#expand_dims(input, axis, name: nil) ⇒ Object
Inserts a dimension of 1 into a tensor’s shape. Given a tensor input, this operation inserts a dimension of 1 at the dimension index axis of input’s shape. The dimension index axis starts at zero; if you specify a negative number for axis it is counted backward from the end.
Options:
138 139 140 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 138 def (input, axis, name: nil) _op(:expand_dims, input, axis, name: name) end |
#fill(dims, value, name: nil) ⇒ Object
This operation creates a tensor of shape dims and fills it with value.
Options:
153 154 155 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 153 def fill(dims, value, name: nil) _op(:fill, dims, value, name: name) end |
#floor(input_a, name: nil) ⇒ Object
Returns element-wise largest integer not greater than x.
Options:
167 168 169 170 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 167 def floor(input_a, name: nil) check_allowed_types(input_a, TensorStream::Ops::FLOATING_POINT_TYPES) _op(:floor, input_a, name: name) end |
#floor_div(input_a, input_b, name: nil) ⇒ Object
Returns element-wise integer divistion.
This operation supports broadcasting
Options:
184 185 186 187 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 184 def floor_div(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:floor_div, input_a, input_b, name: name) end |
#greater(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x > y) element-wise.
This operation supports broadcasting
Options:
201 202 203 204 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 201 def greater(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:greater, input_a, input_b, name: name) end |
#greater_equal(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x >= y) element-wise.
This operation supports broadcasting
Options:
218 219 220 221 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 218 def greater_equal(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:greater_equal, input_a, input_b, name: name) end |
#less(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x < y) element-wise.
This operation supports broadcasting
Options:
235 236 237 238 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 235 def less(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:less, input_a, input_b, name: name) end |
#less_equal(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x <= y) element-wise.
This operation supports broadcasting
Options:
252 253 254 255 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 252 def less_equal(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:less_equal, input_a, input_b, name: name) end |
#log(input, name: nil) ⇒ Object
Computes natural logarithm of x element-wise.
Options:
267 268 269 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 267 def log(input, name: nil) _op(:log, input, name: name) end |
#mat_mul(input_a, input_b, transpose_a: false, transpose_b: false, name: nil) ⇒ Object Also known as: matmul
Multiplies matrix a by matrix b, producing a * b. The inputs must, following any transpositions, be tensors of rank 2 .
This operation supports broadcasting
Options:
285 286 287 288 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 285 def mat_mul(input_a, input_b, transpose_a: false, transpose_b: false, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:mat_mul, input_a, input_b, transpose_a: transpose_a, transpose_b: transpose_b, name: name) end |
#max(input_a, input_b, name: nil) ⇒ Object
Returns the max of x and y (i.e. x > y ? x : y) element-wise.
This operation supports broadcasting
Options:
303 304 305 306 307 308 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 303 def max(input_a, input_b, name: nil) check_allowed_types(input_a, TensorStream::Ops::NUMERIC_TYPES) check_allowed_types(input_b, TensorStream::Ops::NUMERIC_TYPES) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:max, input_a, input_b, name: name) end |
#min(input_a, input_b, name: nil) ⇒ Object
Returns the min of x and y (i.e. x < y ? x : y) element-wise.
This operation supports broadcasting
Options:
322 323 324 325 326 327 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 322 def min(input_a, input_b, name: nil) check_allowed_types(input_a, TensorStream::Ops::NUMERIC_TYPES) check_allowed_types(input_b, TensorStream::Ops::NUMERIC_TYPES) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:min, input_a, input_b, name: name) end |
#mod(input_a, input_b, name: nil) ⇒ Object
Returns element-wise remainder of division.
This operation supports broadcasting
Options:
341 342 343 344 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 341 def mod(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:mod, input_a, input_b, name: name) end |
#mul(input_a, input_b, name: nil) ⇒ Object
Returns x * y element-wise.
This operation supports broadcasting
Options:
358 359 360 361 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 358 def mul(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:mul, input_a, input_b, name: name) end |
#negate(input, name: nil) ⇒ Object
Computes numerical negative value element-wise.
Options:
373 374 375 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 373 def negate(input, name: nil) _op(:negate, input, name: name) end |
#not_equal(input_a, input_b, name: nil) ⇒ Object
Returns the truth value of (x != y) element-wise.
This operation supports broadcasting
Options:
389 390 391 392 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 389 def not_equal(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:not_equal, input_a, input_b, name: name) end |
#ones_like(input, dtype: nil, name: nil) ⇒ Object
Creates a tensor with all elements set to 1. Given a single tensor (tensor), this operation returns a tensor of the same type and shape as tensor with all elements set to 1. Optionally, you can specify a new type (dtype) for the returned tensor.
Options:
408 409 410 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 408 def ones_like(input, dtype: nil, name: nil) _op(:ones_like, input, data_type: dtype, name: name) end |
#pow(input_a, input_b, name: nil) ⇒ Object
Computes the power of one value to another X^Y element wise
This operation supports broadcasting
Options:
424 425 426 427 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 424 def pow(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:pow, input_a, input_b, name: name) end |
#prod(input_a, axis = nil, name: nil, keepdims: false) ⇒ Object Also known as: reduce_prod
Computes the product of elements across dimensions of a tensor. Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each entry in axis. If keepdims is true, the reduced dimensions are retained with length 1. If axis has no entries, all dimensions are reduced, and a tensor with a single element is returned.
Options:
445 446 447 448 449 450 451 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 445 def prod(input_a, axis = nil, name: nil, keepdims: false) check_allowed_types(axis, TensorStream::Ops::INTEGER_TYPES) input_a = TensorStream.convert_to_tensor(input_a) return input_a if input_a.shape.scalar? axis = cast_axis(input_a, axis) _op(:prod, input_a, axis, name: name, keepdims: keepdims) end |
#random_uniform(shape, name: nil, dtype: :float32, minval: 0, maxval: 1, seed: nil) ⇒ Object
Outputs random values from a uniform distribution.
Options:
468 469 470 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 468 def random_uniform(shape, name: nil, dtype: :float32, minval: 0, maxval: 1, seed: nil) _op(:random_uniform, shape, name: name, dtype: dtype, minval: minval, maxval: maxval, seed: seed) end |
#range(start = 0, limit = 0, delta = 1, name: "range", dtype: nil, output_type: :int32) ⇒ Object
Creates a sequence of numbers. Creates a sequence of numbers that begins at start and extends by increments of delta up to but not including limit.
Options:
487 488 489 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 487 def range(start = 0, limit = 0, delta = 1, name: "range", dtype: nil, output_type: :int32) _op(:range, start, limit, delta, name: name, dtype: dtype, output_type: output_type) end |
#rank(input, name: nil) ⇒ Object
Returns the rank of a tensor
Options:
501 502 503 504 505 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 501 def rank(input, name: nil) input = convert_to_tensor(input) return cons(input.shape.ndims) if input.shape.known? _op(:rank, input, name: name) end |
#reshape(input, shape, name: nil) ⇒ Object
Reshapes a tensor. Given tensor, this operation returns a tensor that has the same values as tensor with shape shape.
Options:
519 520 521 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 519 def reshape(input, shape, name: nil) _op(:reshape, input, shape, name: name) end |
#round(input_a, name: nil) ⇒ Object
Rounds the values of a tensor to the nearest integer, element-wise
Options:
533 534 535 536 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 533 def round(input_a, name: nil) check_allowed_types(input_a, TensorStream::Ops::FLOATING_POINT_TYPES) _op(:round, input_a, name: name) end |
#rsqrt(input_a, name: nil) ⇒ Object
Computes reciprocal of square root of x element-wise.
Options:
548 549 550 551 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 548 def rsqrt(input_a, name: nil) check_allowed_types(input_a, TensorStream::Ops::FLOATING_POINT_TYPES) _op(:rsqrt, input_a, name: name) end |
#shape(input, name: nil, out_type: :int32) ⇒ Object
This operation returns a 1-D integer tensor representing the shape of input
Options:
564 565 566 567 568 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 564 def shape(input, name: nil, out_type: :int32) return constant(shape_eval(input, out_type), dtype: out_type, name: "Shape/#{name}") if input.is_a?(Array) && !input[0].is_a?(Tensor) return constant(input.shape.shape, dtype: out_type, name: "Shape/#{input.name}_c") if shape_full_specified(input) _op(:shape, input, name: name, out_type: out_type) end |
#sigmoid(input_a, name: nil) ⇒ Object
Computes sigmoid of x element-wise.
Options:
580 581 582 583 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 580 def sigmoid(input_a, name: nil) check_allowed_types(input_a, TensorStream::Ops::FLOATING_POINT_TYPES) _op(:sigmoid, input_a, name: name) end |
#sign(input_a, name: nil) ⇒ Object
Computes sign of input element-wise. y = sign(x) = -1 if x < 0; 0 if x == 0 or tf.is_nan(x); 1 if x > 0.
Zero is returned for NaN inputs.
Options:
597 598 599 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 597 def sign(input_a, name: nil) _op(:sign, input_a, name: name) end |
#sin(input_a, name: nil) ⇒ Object
Computes sin of input element-wise.
Options:
611 612 613 614 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 611 def sin(input_a, name: nil) check_allowed_types(input_a, TensorStream::Ops::FLOATING_POINT_TYPES) _op(:sin, input_a, name: name) end |
#size(input, name: nil, out_type: :int32) ⇒ Object
Returns the size of a tensor. Returns a 0-D Tensor representing the number of elements in input of type out_type. Defaults to :int32.
Options:
628 629 630 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 628 def size(input, name: nil, out_type: :int32) _op(:size, input, name: name, out_type: out_type) end |
#strided_slice(input, _begin, _end, strides = nil, name: nil) ⇒ Object
Extracts a strided slice of a tensor this op extracts a slice of size ‘(end-begin)/stride`
from the given `input_` tensor. Starting at the location specified by `begin`
the slice continues by adding `stride` to the index until all dimensions are
not less than `end`.
Note that a stride can be negative, which causes a reverse slice.
Options:
650 651 652 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 650 def strided_slice(input, _begin, _end, strides = nil, name: nil) _op(:strided_slice, input, _begin, _end, strides, name: name) end |
#sub(input_a, input_b, name: nil) ⇒ Object Also known as: subtract
Returns x - y element-wise.
This operation supports broadcasting
Options:
666 667 668 669 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 666 def sub(input_a, input_b, name: nil) input_a, input_b = apply_data_type_coercion(input_a, input_b) _op(:sub, input_a, input_b, name: name) end |
#sum(input_a, axis_p = nil, axis: nil, name: nil, keepdims: false) ⇒ Object Also known as: reduce_sum
Computes the sum of elements across dimensions of a tensor. Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each entry in axis. If keepdims is true, the reduced dimensions are retained with length 1. If axis has no entries, all dimensions are reduced, and a tensor with a single element is returned.
Options:
689 690 691 692 693 694 695 696 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 689 def sum(input_a, axis_p = nil, axis: nil, name: nil, keepdims: false) check_allowed_types(axis_p, TensorStream::Ops::INTEGER_TYPES) input_a = TensorStream.convert_to_tensor(input_a) return input_a if input_a.shape.scalar? axis_p = axis_p || axis axis_p = cast_axis(input_a, axis_p) _op(:sum, input_a, axis_p, name: name, keepdims: keepdims) end |
#tan(input_a, name: nil) ⇒ Object
Computes tan of input element-wise.
Options:
709 710 711 712 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 709 def tan(input_a, name: nil) check_allowed_types(input_a, TensorStream::Ops::FLOATING_POINT_TYPES) _op(:tan, input_a, name: name) end |
#tanh(input_a, name: nil) ⇒ Object
Computes tanh of input element-wise.
Options:
724 725 726 727 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 724 def tanh(input_a, name: nil) check_allowed_types(input_a, TensorStream::Ops::FLOATING_POINT_TYPES) _op(:tanh, input_a, name: name) end |
#tile(input, multiples, name: nil) ⇒ Object
Constructs a tensor by tiling a given tensor. This operation creates a new tensor by replicating input multiples times. The output tensor’s i’th dimension has input.dims(i) * multiples elements, and the values of input are replicated multiples times along the ‘i’th dimension. For example, tiling [a b c d] by [2] produces [a b c d a b c d].
Options:
743 744 745 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 743 def tile(input, multiples, name: nil) _op(:tile, input, multiples, name: name) end |
#top_k(input, k = 1, sorted: true, name: nil) ⇒ Object
Finds values and indices of the ‘k` largest entries for the last dimension.
Options:
759 760 761 762 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 759 def top_k(input, k = 1, sorted: true, name: nil) result = _op(:top_k, input, k, sorted: sorted, name: name) [result[0], result[1]] end |
#zeros(shape, dtype: :float32, name: nil) ⇒ Object
Creates a tensor with all elements set to zero
Options:
775 776 777 |
# File 'lib/tensor_stream/generated_stub/ops.rb', line 775 def zeros(shape, dtype: :float32, name: nil) _op(:zeros, shape, dtype: dtype, name: name) end |