Skip to content
python logo

Python

Python is a dynamically typed programming language designed by Guido van Rossum. Much like the programming language Ruby, Python was designed to be easily read by programmers. Because of its large following and many libraries, Python can be implemented and used to do anything from webpages to scientific research.

Here are 119,614 public repositories matching this topic...

subhankar-ghosh
subhankar-ghosh commented Oct 14, 2019

I am using Huber loss implementation in tf.keras in tensorflow 1.14.0 as follows:

huber_keras_loss = tf.keras.losses.Huber(
        delta=delta,
        reduction=tf.keras.losses.Reduction.SUM,
        name='huber_loss'
    )

I am getting the error AttributeError: module 'tensorflow.python.keras.api._v1.keras.losses' has no attribute 'Reduction'

I have tried using tf.losses.

httpie
rshurts
rshurts commented Mar 8, 2017

Brew is listed as the recommended way of installing httpie on macOS. However, it doesn't work with auth plugins.

For example, if you pip3 install requests-hawk and then run http --help hawk will not show as an auth type. If you pip3 install httpie-oauth it will install httpie via pip as a dependency and overwrite the brew installed link in /usr/local/bin/http and now all the plugins wil

requests
rabbbit
rabbbit commented Oct 2, 2017

tldr; in multi-process environment (Celery) sessions might lead to request/responses being mixed up.

It is unsafe to use Session in a multi-process environment - if the fork happens after Session initialisation the underlying connection pool will be shared across both processes, leading to potentially dangerous and hard to debug issues.

I'm not sure what should happen - whather a code change

mohmad-null
mohmad-null commented Jul 13, 2019

When triggered, the DOWNLOAD_MAXSIZE setting raises an ERROR level logging event. I don't think it should be at this level. Error is "something went wrong"; I've explicitly told Scrapy I don't want files of this size, so it's not an error to not download them. WARN or even just INFO makes more sense.

I'm logging Error levels and above to stderr so I can keep track of them easily and it's bein

yf225
yf225 commented Oct 2, 2019

Context

We would like to add the following two APIs to the C++ frontend:

  • torch::nn::TripletMarginLoss , which is the equivalent of Python API torch.nn.TripletMarginLoss.
  • torch::nn::functional::triplet_margin_loss, which is the equivalent of Python API torch.nn.functional.triplet_margin_loss.

Steps

  • Add torch::nn::TripletMarginLossOptions to `torch/csrc/api/i
simonjayhawkins
simonjayhawkins commented Sep 28, 2019

mypy error: pandas\core\arrays\categorical.py:1125:13: error: Incompatible types in assignment (expression has type "List[Any]", variable has type "Set[Any]") [assignment]

Code Sample, a copy-pastable example if possible

Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" f
azl397985856
azl397985856 commented Aug 26, 2019

给你两个数组,arr1 和 arr2,

arr2 中的元素各不相同
arr2 中的每个元素都出现在 arr1 中
对 arr1 中的元素进行排序,使 arr1 中项的相对顺序和 arr2 中的相对顺序相同。未在 arr2 中出现过的元素需要按照升序放在 arr1 的末尾。

 

示例:

输入:arr1 = [2,3,1,3,2,4,6,7,9,2,19], arr2 = [2,1,4,3,9,6]
输出:[2,2,2,1,4,3,3,9,6,7,19]
 

提示:

arr1.length, arr2.length <= 1000
0 <= arr1[i], arr2[i] <= 1000
arr2 中的元素 arr2[i] 各不相同
arr2 中的每个元素 arr2[i] 都出现在 arr1 中

来源:力扣(LeetCode)
链接:

You can’t perform that action at this time.