Top "Tensor" questions

A tensor is a multi-dimensional array.

How can I print the values of Keras tensors?

I am implementing own Keras loss function. How can I access tensor values? What I've tried def loss_fn(y_…

python neural-network keras tensor
Resize PyTorch Tensor

I am currently using the tensor.resize() function to resize a tensor to a new shape t = t.resize(1, 2, 3). This …

python runtime-error pytorch tensor deprecation-warning
RuntimeError: Expected object of backend CUDA but got backend CPU for argument: ret = torch.addmm(torch.jit._unwrap_optional(bias), input, weight.t())

When the forward function of my neural network (after the training phase is completed) is being executed, I'm experiencing RuntimeError: …

python pytorch torch tensor
What is an intuitive explanation of np.unravel_index?

Pretty much what the title says. I've read the documentation and I've played with the function for a while now …

python numpy indexing numpy-ndarray tensor
Understanding tensordot

After I learned how to use einsum, I am now trying to understand how np.tensordot works. However, I am …

python numpy linear-algebra tensor dot-product
What's the difference between "hidden" and "output" in PyTorch LSTM?

I'm having trouble understanding the documentation for PyTorch's LSTM module (and also RNN and GRU, which are similar). Regarding the …

deep-learning pytorch lstm recurrent-neural-network tensor
ValueError: Output tensors to a Model must be the output of a TensorFlow `Layer`

I'm building a model in Keras using some tensorflow function (reduce_sum and l2_normalize) in the last layer while …

python tensorflow machine-learning keras tensor
How to understand the term `tensor` in TensorFlow?

I am new to TensorFlow. While I am reading the existing documentation, I found the term tensor really confusing. Because …

python tensorflow machine-learning deep-learning tensor
Expected object of device type cuda but got device type cpu in Pytorch

I have the following code which calculates a loss function: class MSE_loss(nn.Module): """ : metric: L1, L2 norms or …

python oop pytorch tensor
KerasRegressor Coefficient of Determination R^2 Score

I'm building a small neural net in Keras meant for a regression task, and I want to use the same …

python tensorflow scikit-learn keras tensor