Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The operator tf.cosh return Infinity #8391

Open
liliquan0118 opened this issue Oct 1, 2024 · 1 comment
Open

The operator tf.cosh return Infinity #8391

liliquan0118 opened this issue Oct 1, 2024 · 1 comment
Assignees
Labels

Comments

@liliquan0118
Copy link

Please make sure that this is a bug. As per our
GitHub Policy,
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Mac OS 13.3 (22E252)
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow.js installed from (npm or script link): script link
  • TensorFlow.js version (use command below): 4.2.0
  • Browser version: Chrom Version 128.0.6613.86 (Official Build) (arm64)
  • Tensorflow.js Converter Version:

Describe the current behavior
Given the input [[[2010266160.7859912]]], the operator return Infinity

Output:
image

Describe the expected behavior
Not return Infinity

Standalone code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/CodePen/any notebook.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>bug00</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@4.2.0/dist/tf.js"> </script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@4.2.0/dist/tf-backend-wasm.js"></script>
<script>
    function cosh(backend){
        tf.setBackend(backend);
        tf.ready().then(()=>{var input=[[[2010266160.7859912]]]
            const result = tf.cosh(input);
            console.log("the result of ", backend, "is:\n" );
            result.print();
        })
    }
    async function test() {
        await cosh("webgl");
        await cosh("cpu");
        await cosh("wasm");
    }
    
    test();
</script>
</body>
</html>

Other info / logs Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached.

@liliquan0118 liliquan0118 added the type:bug Something isn't working label Oct 1, 2024
@shmishra99 shmishra99 self-assigned this Oct 1, 2024
@shmishra99
Copy link
Contributor

Hi @liliquan0118 ,

I've successfully reproduced the issue you described with tf.cosh.

Output:

the result of  webgl is:
Tensor
     [ [[Infinity],]]

the result of  cpu is:
Tensor
     [ [[Infinity],]]

the result of  wasm is:
Tensor
     [ [[Infinity],]]

Thank You!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants