摘要:
总结:二者用法一致。a=np.array([[[[10,8,3,9],[5,6,7,8]]],[[[1,2,3,4],[5,6,7,8]]],[[[1,2,3,4],[5,6,7,8]]]] )print('a=',a)print('a.shape=',a.shape)c=np.minimum(a[...,:2], a[...,2:]) # 说明在对应位置找最小值print('c=',c)pri... 阅读全文
摘要:
class A(): def __init__(self,b): self.b=b # def __iter__(self): # 这个函数可以用,表示迭代标志,但也可以省略 # return self def __next__(self): if self.b<10: self.b=self.b+2 else: raise StopIteration self.d=self.b+10 retur 阅读全文
摘要:
import tensorflow as tfg1=tf.Graph()g2=tf.Graph()# x1=tf.constant([[1,2],[2,1]])# y1=tf.constant(2)# z1=tf.subtract(x1,y1)with g1.as_default(): with t 阅读全文