Challenge: Basics of JAX

Test your learning so far by completing a programming exercise.

Important points

Before solving the exercises, please make sure to:

  • Do not change the name of the function below because it will be used by the evaluator.
  • Do not print anything.
  • Do not import any libraries. They are pre-imported. We’ll continue the convention of jnp for JAX NumPy.
  • Variables are usually initialized with 11 to help run the test case. Please override them with intended expressions/values in your implementation.

Note: These points will also apply to all the subsequent challenges.

Exercise 1: Testing array for zeros

Let’s test our familiarity with the basic JAX and NumPy syntax.

In this simple exercise, we are given a JAX array a. Identify whether it contains 00 or not. In other words, if it contains an(y) instance of zero, it should return true and vice-versa.

Get hands-on with 1200+ tech skills courses.