Watch Online. Talvar (2015) 480p. The film is based on the real life Noida Double Murder Case of 2008, where the parents were.Q:
Tensorflow combined window + stride
I am trying to implement combined window with strides with Tensorflow.
The following work :
import tensorflow as tf
w = tf.constant([[2.0, 2.0],
[2.0, 1.0]])
with tf.variable_scope('main', reuse=tf.AUTO_REUSE):
w_mult = w * 2.0
main_shape = tf.shape(w_mult)
# tf.strided_slice(w_mult, [-1, 0, 1, 0],
# [1, 0, 1, 0],
# [1, 1, 1, 1])
print main_shape
output :
(2,)
However, when changing the first argument of tf.strided_slice to [-1, 0, 2, 0], I get an error :
ValueError: Negative dimension size caused by subtracting 1 from dim 0
I would like to understand why does this happen.
I am using Tensorflow 0.12.
A:
The first dimension of w_mult is 1, so the following can be used instead:
import tensorflow as tf
w = tf.constant([[2.0, 2.0],
[2.0, 1.0]])
with tf.variable_scope('main', reuse=tf.AUTO_REUSE):
w_mult = tf.tile(w, multiples=[2, 1, 1, 1])
main_shape = tf.shape(w_mult)
# tf.strided_slice(w_mult, [1, 0, 2, 0],
# ac619d1d87
Related links:
Comments