问题描述
基本上我有两个张量,我试图将两个张量相乘(一个只是大小 [batch](即每个批次具有单个值的张量),以及一个大小为 [batch,x,y,z ]) 使得批次中的每个 3D 张量都按其相应的值进行缩放
目前,我正在尝试以下方法,但我还没有找到有效的方法!:
enc_out1 = tf.math.multiply(enc_out1,w_int,name=None)
#enc_out1 has shape [batch,z],w_int has shape [batch]
非常感谢任何和所有帮助
解决方法
你可以重塑它。 这是一个例子
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\site-packages\PyPDF2\pdf.py",line 1147,in getNumPages
self.decrypt('')
File "C:\Program Files (x86)\Python38-32\lib\site-packages\PyPDF2\pdf.py",line 1987,in decrypt
return self._decrypt(password)
File "C:\Program Files (x86)\Python38-32\lib\site-packages\PyPDF2\pdf.py",line 1996,in _decrypt
raise NotImplementedError("only algorithm code 1 and 2 are supported")
NotImplementedError: only algorithm code 1 and 2 are supported
During handling of the above exception,another exception occurred:
Traceback (most recent call last):
File "main.py",line 11,in <module>
print(pdfReader.getNumPages())
File "C:\Program Files (x86)\Python38-32\lib\site-packages\PyPDF2\pdf.py",line 1150,in getNumPages
raise utils.PdfReadError("File has not been decrypted")
PyPDF2.utils.PdfReadError: File has not been decrypted