我在Codeigniter度过了几个月之后对laravel 4不熟悉,我经历了很多关于laravel的教程,有一件事我想明确是laravel中Routes和Controller之间的实际区别是什么,因为我们可以创建并在控制器和路由中生成视图.有人会简要地向我解释何时在laravel中使用路线和控制器?因为在其他框架中我们需要路由来指定应用程序中的某些特定URL,并且Controller用于执行一些实际任务但是在laravel中我没有获得路由的主要概念,除了路由机制?
我使用简单的tensorflow示例来翻转图像.我使用了reverse_sequence和reverse方法,结果是一样的.如果只使用reverse()方法,我们可以翻转图像,那么我们为什么要使用reverse_sequence()方法呢?我只是想知道这种方法的主要区别是什么?提前致谢 :)
import tensorflow as tf
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
# First, load the image again
filename = "MarshOrchid.jpg"
image = mpimg.imread(filename)
# Create a TensorFlow Variable
x = tf.Variable(image, name='x')
height, width, depth = image.shape
model = tf.initialize_all_variables()
with tf.Session() as session:
# x= tf.reverse(x, dims=[False, True, False],name="reverse")
x = tf.reverse_sequence(x, [width] * height, 1, batch_dim=0)
session.run(model)
result = session.run(x)
print(session.run(x))
plt.imshow(result)
plt.show()
Run Code Online (Sandbox Code Playgroud)