tf.floordiv

tf.floordiv

tf.floordiv

floordiv(
    x,
    y,
    name=None
)

Defined in tensorflow/python/ops/math_ops.py.

See the guide: Math > Arithmetic Operators

Divides x / y elementwise, rounding toward the most negative integer.

The same as tf.div(x,y) for integers, but uses tf.floor(tf.div(x,y)) for floating point arguments so that the result is always an integer (though possibly an integer represented as floating point). This op is generated by x // y floor division in Python 3 and in Python 2.7 with from __future__ import division.

Note that for efficiency, floordiv uses C semantics for negative numbers (unlike Python and Numpy).

x and y must have the same type, and the result will have the same type as well.

Args:

  • x: Tensor numerator of real numeric type.
  • y: Tensor denominator of real numeric type.
  • name: A name for the operation (optional).

Returns:

x / y rounded down (except possibly towards zero for negative integers).

Raises:

  • TypeError: If the inputs are complex.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/floordiv

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部