Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for scalar (0.26 sec)

  1. tensorflow/c/c_api.cc

        if (dst->dims() != 0) {
          return InvalidArgument(
              "Malformed TF_RESOURCE tensor: expected a scalar, got a tensor with "
              "shape ",
              dst->shape().DebugString());
        }
        *dst = tensorflow::Tensor(tensorflow::DT_RESOURCE, dst->shape());
        if (!dst->scalar<tensorflow::ResourceHandle>()().ParseFromString(
                string(static_cast<const char*>(tensor_interface->Data()),
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 102.3K bytes
    - Viewed (0)
  2. tensorflow/c/c_api_test.cc

    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 96.9K bytes
    - Viewed (3)
  3. tensorflow/c/eager/gradient_checker.cc

      int num_dims_out = TF_NumDims(model_out_tensor);
      TF_DeleteTensor(model_out_tensor);
    
      // If the output is a scalar, then return the scalar output
      if (num_dims_out == 0) {
        outputs[0] = model_out.release();
        return absl::OkStatus();
      }
    
      // Else, reduce sum the output to get a scalar
    
      // Will sum all dimensions, so get a Tensor containing [0,...,num_dims_out-1].
      AbstractTensorHandlePtr sum_dims;
      {
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  4. tensorflow/c/eager/parallel_device/parallel_device_lib_test.cc

      const std::vector<int64_t>* shape;
      TF_ASSERT_OK(unknown_length_vector->Shape(&shape));
      EXPECT_THAT(*shape, ElementsAre(-1));
    
      TensorHandlePtr scalar = FloatTensorHandle(2., status.get());
      ASSERT_TRUE(TF_GetCode(status.get()) == TF_OK) << TF_Message(status.get());
      two_vector = VectorFloatTensorHandle({3., 4.}, status.get());
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Thu Jul 08 23:47:35 GMT 2021
    - 15.3K bytes
    - Viewed (0)
  5. tensorflow/c/eager/parallel_device/parallel_device_testlib.cc

        ASSERT_TRUE(TF_GetCode(status.get()) == TF_OK) << TF_Message(status.get());
        delete to_delete;
      };
      std::unique_ptr<Variable, decltype(variable_deleter)> variable(
          Variable::Create(context, TF_FLOAT, /* Scalar */ {}, 0, device_name,
                           status.get()),
          variable_deleter);
      ASSERT_TRUE(TF_GetCode(status.get()) == TF_OK) << TF_Message(status.get());
    
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Tue Jun 15 15:44:44 GMT 2021
    - 12.5K bytes
    - Viewed (0)
  6. tensorflow/c/c_test_util.cc

          found_shape = true;
        }
      }
      return found_dtype && found_shape;
    }
    
    bool IsScalarConst(const tensorflow::NodeDef& node_def, int v) {
      if (node_def.op() != "Const" || node_def.name() != "scalar") {
        return false;
      }
      bool found_dtype = false;
      bool found_value = false;
      for (const auto& attr : node_def.attr()) {
        if (attr.first == "dtype") {
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Fri Oct 15 03:16:52 GMT 2021
    - 17.8K bytes
    - Viewed (2)
  7. tensorflow/c/eager/unified_api_test.cc

      }
    
     public:
      bool UseMlir() const { return strcmp(std::get<0>(GetParam()), "mlir") == 0; }
      bool UseFunction() const { return std::get<2>(GetParam()); }
    };
    
    // Checks that inputs[0] is a scalar.
    Status TestScalarShape(AbstractContext* ctx,
                           absl::Span<AbstractTensorHandle* const> inputs,
                           absl::Span<AbstractTensorHandle*> outputs) {
      PartialTensorShape shape;
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Tue Feb 27 13:57:45 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  8. tensorflow/c/c_api_function_test.cc

       *                   v
       */
      // Define
      TF_Operation* c = ScalarConst(10, func_graph_, s_, "scalar10");
      Define(-1, {}, {}, {c}, {});
    
      // Use, run, and verify
      TF_Operation* func_op = Use({});
      Run({}, func_op, 10);
      VerifyFDef({"scalar10_0"}, {}, {{"scalar10", DT_INT32}},
                 {{"scalar10_0:output:0", "scalar10"}}, {});
    }
    
    TEST_F(CApiFunctionTest, OneOp_OneInput_OneOutput) {
      /*
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Thu Jul 20 22:08:54 GMT 2023
    - 63.6K bytes
    - Viewed (6)
  9. tensorflow/c/c_api_experimental_test.cc

      TFE_OpSetAttrType(fill_op, "T", TF_FLOAT);
      TFE_OpSetAttrType(fill_op, "Tshape", TF_INT32);
    
      float five = 5.0;
      TFE_TensorHandle* scalar = TestScalarTensorHandle(tfe_context_, five);
      TF_Tensor* scalarTensor = TFE_TensorHandleResolve(scalar, status_);
      CHECK_EQ(TF_OK, TF_GetCode(status_)) << TF_Message(status_);
      CheckOutputShapes(fill_op,
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Tue Jan 17 22:27:52 GMT 2023
    - 13.1K bytes
    - Viewed (1)
Back to top